Follow @Lusse3 (236 followers)

Flickr Recent Photos

Soluppgången i KnivstaEn vacker morgonPalt palt i stora lass! Sara lyckades magnifikt med sin första palt sats #bArkham horrorDe gjorde bättre tidningar förr :) "gör det själv" från 1970 talet #fbPlanterar litePotatistävlingDragkampDragkampPotatistävlingMini DragkampKapten Liam

Kategorier

IE7 CSS Background not showing

Sometimes backgrounds will be visible using firefox but not IE7 which makes you wonder…. why?

The reason is pretty simple. CSS needs to be perfect for IE to understand them.

A perfect example would be.

body{

background:#fff url(picture.jpg)no-repeat;

}

That piece of CSS will work on Firefox but not on IE7 (funny thing is that it MIGHT work on IE7 but it wont most of the time)

body{

Background-image:url('image.jpg');
Background-repeat:no-repeat;
Background-color:#fff;

}

This will on the other hand work. As you can see, they have the same content, just a different layout.

You can of course put it in one row but make sure to have the right format, otherwise you’ll still have the same problem.

body{

background:#fff url(picture.jpg) no-repeat;

}

As you can see, the only difference is the space between ”.jpg)” and ”no-repeat”

Try this page with both Firefox and IE7 and you’ll see that IE7 won’t show the background, but Firefox will.

16 comments to IE7 CSS Background not showing

  • Thanks. I was about to pull my hair out over a single space between the image url and no-repeat.

  • UvaNo Gravatar

    It doesn’t work for me.

    This is my code:
    .cel1 img{
    background:url(bg.png)no-repeat;
    padding: 2px;
    }

    Can you help me!

  • Hi Uva

    Your code looks right, but as I said in my post, you need to be careful with the spaces. Make sure yo have a space between url(bg.png) and no-repeat and it will work ;)

  • hi. For me didn’t work either but when i written separatly it has been worked.
    thx

  • Thanks man! You totally saved me! :D

  • royNo Gravatar

    Thanks for this info – can’t believe IE would do this!

  • We really cherish this website. Wewish we could come here everyday\all day.

  • Thanks. Solved my problem. Wish I had found this a week ago. What a PITA.

  • Unquestionably believe that that you said. Your favorite justification seemed to be on the net the simplest factor to take note of. I say to you, I certainly get irked at the same time as people think about worries that they plainly do not realize about. You controlled to hit the nail upon the top and also defined out the whole thing without having side effect , people could take a signal. Will probably be again to get more. Thanks – Elegant London Escorts, 65-67 Brewer Street, Floor: 2, London W1F 9UP. Phone: 020 3011 2941

  • You must be joking me, I nearly deleted the website as it was driving me nuts. Than I used the good ol google and found this. Thanks man ;)

  • Hehe I know. Ie has plenty of cute little bugs. Glad I could help ;)

  • Hi Rizo thanks da machi……;)

  • I was getting frustrated and even installed the newest version of IE. Thanks for your help. I wish IE could get with the program and be like Firefox.

  • JanNo Gravatar

    Thank you so much! that was maddening!!!!

  • hi,

    This might sound strange but in my case the background is shown some time, i used jquery, do you think there is some problem there

    here is the code

    #popup
    {
    width:825px;
    height:500px;
    display:none;
    position:absolute;
    top:50%;
    left:50%;
    margin-left:-413px;
    text-align:left;
    z-index:21000;
    background:url(‘images/popup_bg.png’) no-repeat;
    /* background-position:center;
    background:#FFC0B0;
    border:1px solid #ffffff; */
    }

Kommentera

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Additional comments powered by BackType