简体   繁体   中英

I cant get my logo to appear on the navbar

This is what I'm getting right now For some reason when I try to get my navbar logo to appear, instead of the logo, I get some type of picture icon. Here is my code:

`<body>
<nav class="navbar navbar-expand-sm navbar-dark bg-dark">
    <a href="#" class="navbar-brand"><img src="/images/logo.png">Imito</a>
<div class="collapse navbar-collapse" id="topNavBar">
    <ul class="navbar-nav mr-auto">
        <li class="nav-item">
            <a href="#" class="nav-link">Hot</a>
        </li>
        <li class="nav-item">
            <a href="#" class="nav-link">New</a>
        </li>
        <li class="nav-item">
            <a href="#" class="nav-link">Top</a>
        </li>
    </ul>
</div>`

This happens when your program is unable to locate the picture in the specified path or it cannot access the specified path. My advice is to place the logo in the same folder as the html code and just use <img src = "logo.png">

It should definitely work then.

Can't comment so had to use an answer, have you checked the console to see if it returns a 404 for the image. It sounds like the file you specified cannot be found?

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