Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old August 30th, 2008, 04:25 PM
Newbie
 
Join Date: Aug 2008
Posts: 2
Default Multiple column problem with IE7 when using background-color

I added a 3 column lists to my site using the techniques shown on
http://www.communitymx.com/content/a...ge=1&cid=27F87

I first tried their code by itself and it worked fine. When I merged it into my own, it worked fine with Firefox and Safari but not on IE 7.

IE7 displayed the 3rd column but the first two columns were not shown. I was able to reproduce with the original small test by adding a background-color statement to #lists. When this statement is omitted it works in all 3 browsers.

======================================
My HTML:

[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Horizontal Navigation Bar Tests</title>
<link rel="stylesheet" type="text/css" href="list4C1.css" />
</head>

<body>

<div id="lists">
<ol>
<li class="col1">Antelope</li>
<li class="col1">Baboon</li>
<li class="col1">Bison</li>
<li class="col1">Camel</li>
<li class="col1">Chimpanzee</li>
<li class="col2 coltopper">Deer</li>
<li class="col2">Eland</li>
<li class="col2">Elk</li>
<li class="col2">Gazelle</li>
<li class="col2">Gibbon</li>
<li class="col3 coltopper">Kangaroo</li>
<li class="col3">Meerkat</li>
<li class="col3">Sheep</li>
<li class="col3">Warthog</li>
<li class="col3">Zebra</li>
</ol>



<ul>
<li class="col1">Antelope</li>
<li class="col1">Baboon</li>
<li class="col1">Bison</li>
<li class="col1">Camel</li>
<li class="col1">Chimpanzee</li>
<li class="col2 coltopper">Deer</li>
<li class="col2">Eland</li>
<li class="col2">Elk</li>
<li class="col2">Gazelle</li>
<li class="col2">Gibbon</li>
<li class="col3 coltopper">Kangaroo</li>
<li class="col3">Meerkat</li>
<li class="col3">Sheep</li>
<li class="col3">Warthog</li>
<li class="col3">Zebra</li>
</ul>

</div>

<p> http://www.communitymx.com/content/article.cfm?cid=27f87 </p>

</body>
</html>
[/HTML]
================================================== =
My CSS:

Expand|Select|Wrap|Line Numbers
  1. body{
  2.   background-color:  yellow;
  3. }
  4.  
  5. #lists{
  6.   margin: 0;
  7.   /* when background-color is removed from this section, the lists will be displayed correctly in IE ;*/
  8.   background-color:  white;  
  9. }
  10.  
  11. li {
  12.   margin: 0;
  13.   padding: 0;
  14.   line-height: 1.3em;
  15. }
  16.  
  17. .col1 {margin-left: 3em;}
  18.  
  19. .col2 {margin-left: 13em;}
  20.  
  21. .col3 {margin-left: 23em;}
  22.  
  23. .coltopper {margin-top: -6.5em;}

Last edited by acoder; August 31st, 2008 at 06:01 PM. Reason: Please use [code] tags
Reply
  #2  
Old August 30th, 2008, 05:53 PM
David Laakso's Avatar
Expert
 
Join Date: Aug 2008
Location: US
Posts: 302
Default

I think it's an "on having layout" [1] issue for IE/6 and IE/7.
The hasLayout trigger to bring it up in the IEs is to:
Expand|Select|Wrap|Line Numbers
  1. #lists{
  2. margin: 0;
  3. /* when background-color is removed from this section, the lists will be displayed correctly in IE ;*/
  4. background-color: white;
  5. zoom:1;<-------------------------- :: add this.
  6. }
  7.  
[1] on having layout
Reply
  #3  
Old August 30th, 2008, 08:12 PM
Newbie
 
Join Date: Aug 2008
Posts: 2
Default

Thank you very much! The zoom took care of it.
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles