<html>
<head></head>
<body>
<div id="leftcolumn"></div>
<div id="rightcolumn"></div>
<div id="centercolumn">
Этот синий блок должен быть высотой в несколько строк текста, разве не так?
<div style="clear:both;"></div>
</div>
<div style="clear:both;"></div>
<br><br> А вот так должно быть: <br><br><br>
<div id="leftcolumn"></div>
<div id="rightcolumn"></div>
<div id="centercolumn">
Этот синий блок высотой в несколько строк текста.
</div>
<div style="clear:both;"></div>
<br><br> Ещё можно использовать таблицу: <br><br><br>
<div id="leftcolumn"></div>
<div id="rightcolumn"></div>
<div id="centercolumn">
<table>
<tr>
<td>
Этот синий блок высотой в несколько строк текста несмотря на то, что в нём есть блок с clear:both;
<div style="clear:both;"></div>
</td>
</tr>
</table>
</div>
<div style="clear:both;"></div>
</body>
</html>
CSS
body {font-family:Arial, sans-serif;font-weight:bold;font-size:14px;}
#leftcolumn {width:100px;float:left;height:400px;background:red;}
#rightcolumn {width:100px;float:right;height:400px;background:red;}
#centercolumn {margin:0px 100px;background:blue;color:#FFF;}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.