Trojan Trojan - 2 months ago 6
HTML Question

how to add image using bootstrap?

i have this code for navbar all works perfectly but when i try to replaced the text by an image the image does not displaying.

here's the code:

<a href="#" class="dropdown-toggle" data-toggle="dropdown"><img src="DAR.png" class="img-responsive"><b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Sign-in</a></li>
<li><a href="#">Sign-up</a></li>
</ul>

Answer

You can add a image inside link. check out this fiddle. And make sure that path to the image is correct. If the path is right it should work. I changed your image and its working now.

<a href="#" class="dropdown-toggle" data-toggle="dropdown"><img src="https://s13.postimg.org/pzvk4df07/1475139047_three_bars.png" class="img-responsive"><b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="#">Sign-in</a></li>
                                <li><a href="#">Sign-up</a></li>
                            </ul>