简体   繁体   中英

Twitter bootstrap - images not showing

I have a website which works fine in Google Chrome, but not in other browsers (Firefox, Safari).

I'm having a problem with the following section of code:

        <div class="span2">
            <img src="./images/ads/karaoke.png" />
            <br><br><br>
            <img src="./images/ads/euros.png" />
            <br><br><br><br>
            <img src="./images/ads/parties.png" />
            <br><br><br><br>
            <img src="./images/ads/traleeDynamos.png" />
        </div>

As you can see, I'm displaying 4 images along the right hand side of the site. But the images won't render in Firefox!!!

What am I doing wrong?

The images show up in Firebug and when I hover over the in Firebug, I can see the correct image. But it simply will not appear on the page.

I'd really appreciate someone looking at the code.

Many thanks in advance,

I can't replicate what you're seeing, but I don't have Firefox 11, however, a few things: the markup on that page is seriously outdated. Ditch <center> element, etc, and get rid of all the deprecated elements. Then validate the markup and styles. I noticed your first img has a closing </img> element... that's not valid and I'm willing to bet it's what's causing your issue(s).

Remember, validation is your friend.

From the bootstrap documentation :

Requires HTML5 doctype

Bootstrap makes use of HTML elements and CSS properties that require the use of the HTML5 doctype. Be sure to include it at the beginning of every Bootstrapped page in your project.

Currently you have:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 //EN">

As a doctype, so fix that, validate and try again to see if it works.

如果您的图片未在firefox中显示,并且打算使用浏览器的整个宽度,请确保添加class =“ container-fluid”

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