You are here: How take two columns the same height? « HTML « IT news, forums, messages
How take two columns the same height?

Posted by Jens Lenge on 04/06/07 18:58

Hello world,

although this sounds like a FAQ to me, a have found no answer yet: How
can I make two columns the same height in a CSS-based layout without
using a table and without specifying a *fixed* height?
Both columns have a fixed width and adjust their height so that the
respective content fits in. Now the smaller height should be increased
so that both columns have the same height.

Can this be done with CSS only?

Small example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15"/>
<title>Example</title>
</head>
<body>
<div style="border: 1px solid black">
<div style="float:left; width:120px; background-color:red">
This is column #1.<br>
This is column #1.<br>
This is column #1.<br>
This is column #1.<br>
This is column #1.<br>
.... (more content)
</div>
<div style="float:right; width:120px; background-color:green">
This is column #2.<br>
This is column #2.<br>
.... (more content)
</div>
How to make the red and green columns have the same height?
</div>
</body>
</html>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация