Anchor image using Boostrap |
Hey all!
Through this forum Ive become comfortable with anchors and functions (THANK YOU ) but only with linking text. How do you link an image. I want to use this: Code: <a class="navbar-brand" href="#"> , Mekaboo Code: <img src="<?= base_url('/docs/4.3/assets/brand/bootstrap-solid.svg');?>" width="30" height="30" alt="" What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(05-10-2019, 06:34 AM)php_rocs Wrote: @Mekab00, Solid, Thank You as well (05-10-2019, 03:23 AM)InsiteFX Wrote:I treid what you gave me and its not working. Im trying to link image with controller/function like this but instead of button it will be an image. I at URL helper info and it seems as if it only links to text not image.
The anchor() function takes 3 arguments.
1. URI string 2. Title 3. Options (optional) The second argument (title) can be a simple text like 'Click here', but it can also be an image or any other html element. PHP Code: $image = '<img src="' . base_url('assets/images/example.png') . '" width="30" height="30" alt="" />'; In this example, the result is an image (example.png) that is clickable, like a normal hyperlink. The link points to the login function in the users controller. (05-11-2019, 05:18 AM)Wouter60 Wrote: The anchor() function takes 3 arguments. Thank you so very much I got the img src part but I couldnt link it. Thanks for the help!! |
Welcome Guest, Not a member yet? Register Sign In |