简体   繁体   中英

add logo image to bootstrap navbar

I used the prescribed method from bootstrap docs

    <div class="container">
        <a class="navbar-brand" href="#">
          <img src="/img/hangers.jpg" alt="" width="30" height="24">
        </a>
      </div>

but the image doesn't display在此处输入图像描述

And Yes, I linked the path correctly. I checked like 50 times already.

Here is the directory structure在此处输入图像描述

Put a dot before the source of the image file. 在此处输入图像描述 Results

在此处输入图像描述

I think. You are not able to pick up photo from your system as code works fine run snippet below:

 <div class="container"> <a class="navbar-brand" href="#"> <img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTW6509Xrnys2Pp_8RB3ffNOsqDrKlPtkvkRQ&usqp=CAU" alt="" width="30" height="24"> </a> </div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM