Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Faux Columns - Only working in Firefox/Mozilla

Status
Not open for further replies.

Rieekan

Programmer
Apr 2, 2001
737
US
I'm sure I've done something wrong with this, but I can't seem to get the Faux Columns solution working in IE. Below is some pseudo code (site is not on the internet as yet, so I do not have a link to an actual page).

The leftNav.gif is a 168 x 1px graphic to highlight the section in a light blue coloring (HTML code: #D4E5F7), but it doesn't seems to repeat vertically as the style sheet requires.

CSS
Code:
html>body body {
font-size:16px;
}

body {
background-color:#FFF;
font-family:Arial,Helvetica,sans-serif;
font-size:100%;
text-align:center;
margin:10px 0 0 10px;
}

#container {
margin-left:auto;
margin-right:auto;
text-align:left;
width:760px;
}

#mainContent {
background:url(../../images/other/leftNav.gif) 0 0 repeat-y;
}

#mainContent:after {
clear:both;
display:block;
height:0; 
visibility:hidden;
content:'text';
}

#leftNav {
vertical-align:top;
width:22%;
float:left;
background-color:#D4E5F7;
}

#contentMiddle {
width:53%;
float:left;
}

#contentRight {
background-color:#FFF;
width:25%;
float:right;
}

HTML:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
</head>
<body>
<div id="container">
  <div id="mainContent"> 
    <div id="leftNav">
      <ul>
        <li>navigation</li>
        <li>navigation</li>
        <li>navigation</li>
        <li>navigation</li>
      </ul>
    </div>
    <div id="contentMiddle">
      <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut sed nulla. Quisque neque enim, vestibulum a, commodo non, tincidunt quis, risus. Integer porttitor scelerisque orci. Nam malesuada luctus turpis. Aliquam cursus ipsum id odio. Suspendisse viverra varius massa. Nulla facilisi. Nam sapien mi, laoreet nec, venenatis vitae, lacinia quis, lorem. Vivamus eleifend enim sit amet orci. Cras ornare tortor et neque. Praesent at quam. Etiam et nibh quis nisl adipiscing luctus. Ut sit amet orci. Suspendisse mauris massa, fringilla in, adipiscing eget, dapibus iaculis, felis. Praesent mi tortor, aliquam ut, ultrices quis, rhoncus sed, urna. Mauris pretium, turpis in sagittis viverra, nisl augue mollis diam, ac tincidunt felis justo eget felis. Fusce ultricies pede ac ligula. Nulla nibh dui, varius in, lobortis at, ultricies a, erat. </p>
    </div>
    <div id="contentRight">
      content content content. . .
    </div>
  </div>
</div>
</body>
</html>

Thanks in advance!

- George
 
It is only working in Mozilla because you have the clear: both; in the :after section, which is a pseudo class that IE does not understand. You could try giving your #mainContent [tt]overflow: auto;[/tt]
 
Duh, completely forgot out IE not handling those pseudo classes.

Unfortunately, the same problem exists when using [tt]overflow:auto;[/tt].

Any other suggestions?

- George
 
For a quick and dirty fix add [tt]background: url(../../images/other/leftNav.gif) 0 0 repeat-y;[/tt] to #container as well.
 
Well, that'd work, except there's a header and footer element that cause it to be a no-go. (Footer in particular due to a 15px margin on the bottom... client doesn't want the footer to touch the end of the browser)

Thanks for your help guys... I've determined that there's something in my CSS that's stopping IE from repeating the background after the 9th time, just about the time the secondary navigation starts...

If I get some more time, I'll post additional code or the answer (when I find it).

- George
 
Don't we all just love examples that are entirely different to the actual code so that we can give you advice that is not applicable to you.

Give [tt]clear: both;[/tt] to your footer.
 
I found the solution...

Placing a height of 100% on the MainContent style fixed the issue in IE.

Thanks for everyone who helped.

- George
 
It handles it just fine. My test page had that in mind when I tried this fix.

- George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top