Neil Marshall wrote:
> I was recently asked how to do this (exactly) with CSS and I just
> couldn't come up with an answer. Does anyone here know?
>
> http://www.eightlines.com/tech/colum...lelayout1.html
> http://www.eightlines.com/tech/colum...lelayout2.html
>
I managed to come up with something that at least works in Mozilla. It
fails in IE and opera gets it mostly right (For some reason the floated
columns don't fill 100% of the space). I'm essentially just recreating
a table using CSS though.
Anyone know how to fix the opera bug at least? (I don't think the IE
bug can be fixed)
http://www.eightlines.com/tech/columns/csslayout1.html
http://www.eightlines.com/tech/columns/csslayout2.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>CSS Layout</title>
<style type="text/css">
#evWrap {
display: table;
height: 99%;
width: 100%;
border: 3px solid blue;
}
#header, #footer {
display: table-row;
}
#colWrap {
display: table-row;
border: 2px solid magenta;
}
#column1 {
border: 1px solid black;
float: left;
width: 100px;
height: 99%;
}
#column3 {
border: 1px solid black;
width: 100px;
float: right;
height: 99%;
}
#column2 {
border: 1px solid black;
margin: 0px 100px 0px 100px;
height: 99%;
}
</style>
</head>
<body>
<div id="evWrap">
<div id="header">Header</div>
<div id="colWrap">
<div id="column1">Column 1</div>
<div id="column3">Column 3</div>
<div id="column2">Column 2</div>
</div>
<div id="footer">Footer</div>
</div>
</body>
</html>