Trying to get 3 column layout working | Familiar Sight | | Join Date: Sep 2007
Posts: 221
| | | |  | Expert | | Join Date: Sep 2006
Posts: 5,577
| | | re: Trying to get 3 column layout working
Before I can work on this, you have a problem with your CSS. You are relying on the property max-width. max-width does not work in IE but does in modern browsers. Therefore, setting it to 40em messes things up in Firefox, Opera, etc. So we must get your markup working in a proper browser before we can hack it for IEs many problems.
| | Familiar Sight | | Join Date: Sep 2007
Posts: 221
| | | re: Trying to get 3 column layout working Quote:
Originally Posted by drhowarddrfine Before I can work on this, you have a problem with your CSS. You are relying on the property max-width. max-width does not work in IE but does in modern browsers. Therefore, setting it to 40em messes things up in Firefox, Opera, etc. So we must get your markup working in a proper browser before we can hack it for IEs many problems. It works in IE7 which I was testing on. I'll have to set a width rather than max-width I guess.
|  | Expert | | Join Date: Sep 2006
Posts: 5,577
| | | re: Trying to get 3 column layout working
IE7 is nine years behind web standards and buggy. Always test in a modern browser first. Then we can adjust for IEs quirks.
| | Familiar Sight | | Join Date: Sep 2007
Posts: 221
| | | re: Trying to get 3 column layout working Quote:
Originally Posted by drhowarddrfine IE7 is nine years behind web standards and buggy. Always test in a modern browser first. Then we can adjust for IEs quirks. Should I be testing in firefox 2.0? That's what I've been using as my primary
| | Familiar Sight | | Join Date: Sep 2007
Posts: 221
| | | re: Trying to get 3 column layout working
Ok, I changed my css to use a percentage width rather than use max-width. Is there a better way to achieve what I'm trying to do now that I can't use max-width? -
*{
-
padding:0;
-
margin:0;
-
font-size:100%;
-
}
-
body{
-
font-family:Arial,Verdana,sans-serif;
-
color:#666;
-
margin:0;
-
padding:0;
-
/*border:1px solid blue;*/
-
}
-
.clear{
-
clear:both;
-
}
-
#pageContainer{
-
margin:1% 10% 0 10%;
-
border-left:1px solid #999;
-
border-right:1px solid #999;
-
border-top:1px solid #999;
-
}
-
#banner{
-
padding:5px;
-
border-bottom:1px solid #999;
-
background-color:#036;
-
}
-
#banner h5{
-
/*padding:1em 0;*/
-
font-size:1.5em;
-
color:#DDD;
-
}
-
#navBar{
-
padding:10px;
-
float:left;
-
/*border:1px solid #CCC;*/
-
}
-
#navBar ul{
-
list-style-type: none;
-
}
-
#rightNavBar{
-
padding:10px;
-
float:right;
-
/*border:1px solid #CCC;*/
-
}
-
#rightNavBar ul{
-
list-style-type: none;
-
}
-
#content{
-
/*margin: 10px 15px;*/
-
float:left;
-
width:75%;
-
padding: 1em;
-
/*max-width: 40em;*/
-
border-left:1px solid #999;
-
border-right:1px solid #999;
-
}
-
#footer{
-
border-top:1px solid #999;
-
border-bottom:1px solid #999;
-
background-color:#036;
-
}
-
#footer h5{
-
font-size:.75em;
-
text-align:right;
-
color:#DDD;
-
padding:.50em .25em;
-
}
-
|  | Expert | | Join Date: Sep 2006
Posts: 5,577
| | | re: Trying to get 3 column layout working Quote:
Originally Posted by dmorand Should I be testing in firefox 2.0? That's what I've been using as my primary That is a good choice, along with Opera and Safari. But do look at IE at the same time, while validating, to catch IE bugs early in the process.
| | Familiar Sight | | Join Date: Sep 2007
Posts: 221
| | | re: Trying to get 3 column layout working Quote:
Originally Posted by drhowarddrfine That is a good choice, along with Opera and Safari. But do look at IE at the same time, while validating, to catch IE bugs early in the process. What's the best way to ensure that my columns are the same width? There are so many annoying nuances when designing. I wish it was easier.
| | Familiar Sight | | Join Date: Sep 2007
Posts: 221
| | | re: Trying to get 3 column layout working Quote:
Originally Posted by dmorand What's the best way to ensure that my columns are the same width? There are so many annoying nuances when designing. I wish it was easier. Should I be using javascript to get my columns to have equal length?
|  | Expert | | Join Date: Sep 2006
Posts: 5,577
| | | re: Trying to get 3 column layout working
I've never had any problems getting width to be the same. Can you give an example?
Height can be a little tricky but some markup is easier than others. Sometims it's as simple as 'height:100%', remembering that height would be in relation to its parent which is in relation to its parent, and so on.
Other times absolute positioning is the only way, or using trickery (google "faux columns").
| | Familiar Sight | | Join Date: Sep 2007
Posts: 221
| | | re: Trying to get 3 column layout working Quote:
Originally Posted by drhowarddrfine I've never had any problems getting width to be the same. Can you give an example?
Height can be a little tricky but some markup is easier than others. Sometims it's as simple as 'height:100%', remembering that height would be in relation to its parent which is in relation to its parent, and so on.
Other times absolute positioning is the only way, or using trickery (google "faux columns"). I looked into the faux columns trick, but I don't really want to implement that on my site. I'll just muck around with it. I think I'll just set a fixed height on my left/right columns, and my middle content should generally be longer.
| | Newbie | | Join Date: Jan 2008
Posts: 1
| | | re: Trying to get 3 column layout working
try this http://xmlci.blogspot.com/2008/01/body-margin0px-padding0px-text.html
| | Member | | Join Date: Jul 2007
Posts: 37
| | | re: Trying to get 3 column layout working
Visit Float Box Layout overview then http://jp29.org/ for a HTML/CSS Validated three column exemplar that functions in all Browsers at different screen resolutions, including PDAs.
BTW, your use of H5 is not semantically correct -- use CSS to set the sizing parameters instead -- check the CSS of the above exemplars (via the W3C CSS Validator) for some ways to accomplish this.
James
|  | | | | /bytes/about
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 226,510 network members.
|