Background image is not displayed in IE 7

Reply

Join Date: Mar 2009
Posts: 2
Reputation: clekkas is an unknown quantity at this point 
Solved Threads: 0
clekkas clekkas is offline Offline
Newbie Poster

Background image is not displayed in IE 7

 
0
  #1
Mar 5th, 2009
Hi everyone,

Kind of a newbie in the web design arena and therefore my apologies if this post is a repeat of a previous one, all the ones I found to be similar didn't seem to fix my problem

I have a list surounded with a class which its purpose is to add a tick for each list item. it works find in FF but of course not in IE7

here is the code

HTML and CSS Syntax (Toggle Plain Text)
  1.  
  2. <ul class="tick-list">
  3. <li>A&amp;E onsite</li>
  4. <li>
  5. <img src="/img/scorecards/Fair.gif" alt="Fair" title="Fair" /> blah blah
  6. </li>
  7. </ul>

and here is the css

HTML and CSS Syntax (Toggle Plain Text)
  1.  
  2.  
  3. ul.tick-list li {background:#fff url(/img/find-services/listings/tick-list.gif)no-repeat 0 0; padding:0 0 .6em 27px; min-height:21px;}

If anyone can help that will be great

thanks
Last edited by clekkas; Mar 5th, 2009 at 12:57 pm.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 45
Reputation: colweb is an unknown quantity at this point 
Solved Threads: 1
colweb colweb is offline Offline
Light Poster

Re: Background image is not displayed in IE 7

 
0
  #2
Mar 6th, 2009
You should place the list inside a div and give the surrounding div a background. Like so;
HTML and CSS Syntax (Toggle Plain Text)
  1. <head>
  2. <html>
  3. <style type = "text/css">
  4. ul.tick-list li {padding:0 0 .6em 27px; min-height:21px;}
  5. .ulwrapper {background:#fff url(/img/find-services/listings/tick-list.gif) no-repeat 0 0;}
  6. </style>
  7. <body>
  8. <div class="ulwrapper">
  9.  
  10. <ul class="tick-list">
  11. <li>A&amp;E onsite</li>
  12. <li>
  13. <img src="/img/scorecards/Fair.gif" alt="Fair" title="Fair" /> blah blah
  14. </li>
  15. </ul>
  16. </div>
  17. </body>
  18. </html>

The above code works in IE 7 and Firefox 3.
Last edited by colweb; Mar 6th, 2009 at 9:07 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 45
Reputation: colweb is an unknown quantity at this point 
Solved Threads: 1
colweb colweb is offline Offline
Light Poster

Re: Background image is not displayed in IE 7

 
0
  #3
Mar 6th, 2009
The copy of the code didn't go correctly. It should start with <html> and just before the body </head>.
Last edited by colweb; Mar 6th, 2009 at 11:48 am.
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 2
Reputation: clekkas is an unknown quantity at this point 
Solved Threads: 0
clekkas clekkas is offline Offline
Newbie Poster

Re: Background image is not displayed in IE 7

 
0
  #4
Mar 9th, 2009
Hi colweb,

That did the trick, if it is easy to explain why this is needed it will be good to know for future purposes

Thanks for your quick reply and help
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,193
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 162
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Sensei

Re: Background image is not displayed in IE 7

 
0
  #5
Mar 9th, 2009
Lists are not block objects, and won't take an image.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 45
Reputation: colweb is an unknown quantity at this point 
Solved Threads: 1
colweb colweb is offline Offline
Light Poster

Re: Background image is not displayed in IE 7

 
0
  #6
Mar 9th, 2009
Originally Posted by clekkas View Post
Hi colweb,

That did the trick, if it is easy to explain why this is needed it will be good to know for future purposes

Thanks for your quick reply and help
It seems the problem is solved than. And MidiMagic has already explained why it needs the surrounding div. Please press the "solved" butten next time.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC