gaptrast
Member
- Messages
- 123
- Reaction score
- 0
- Points
- 16
Did you understand it? Is there a solution to solve it?
If by any chance you want your columns to be the same height there are few solutions to that, but if you want one that will stay away from javascript here's the code that take 3 columns and makes them all the same height of the longest. It's a dirty trick, but whoo whoo CSS is fun :redface:Two floated divs with different heights according to the content.
<!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" xml:lang="en" lang="en">
<head>
<title>My title</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
#container3 {
float:left;
width:100%;
background:green;
overflow:hidden;
position:relative;
}
#container2 {
float:left;
width:100%;
background:yellow;
position:relative;
right:30%;
}
#container1 {
float:left;
width:100%;
background:red;
position:relative;
right:40%;
}
#col1 {
float:left;
width:26%;
position:relative;
left:72%;
overflow:hidden;
}
#col2 {
float:left;
width:36%;
position:relative;
left:76%;
overflow:hidden;
}
#col3 {
float:left;
width:26%;
position:relative;
left:80%;
overflow:hidden;
}
</style>
</head>
<body>
<div id="container3">
<div id="container2">
<div id="container1">
<div id="col1">
Column 1
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
Bottom of Column 1
</div>
<div id="col2">
Column 2
<p> </p>
<p> </p>
<p> </p>
Bottom of Column 2
</div>
<div id="col3">
Column 3
<p> </p>
Bottom of Column 3
</div>
</div>
</div>
</div>
</body>
</html>