Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

put an image on an anchor tag

Tags:

html

css

I have an ul like below which has anchor tags.

<ul class="nav-link-bottom">
        <li><a class="active"  href="login.html">Existing user</a></li>
        <li><a href="signup.html" style = "background-color:#000">new user</a></li>
</ul>

I want to place an image on the second anchor tag. Not sure how I can do that.

Here's the fiddle. And the image I want to put on the left anchor same position as the caret you see.

like image 303
Suraj Avatar asked Dec 15 '22 00:12

Suraj


2 Answers

Don't really understand you question but if you want the img to serve as link, you could do

<a href="page.html"><img src="img.png"></a>

And then give the anchor tag what ever height or width

like image 182
Oke Tega Avatar answered Dec 31 '22 09:12

Oke Tega


<li><a href=""><img src="" alt=""></a></li>
like image 21
Michael Benjamin Avatar answered Dec 31 '22 07:12

Michael Benjamin