2011-09-17 32 views
2
<!DOCTYPE html> 
<html> 
<head> 
<style> 
* {margin:0;padding:0;outline:0;border:0;} 
aside {background:red;width:40%;display:table-cell;} 
.two {width:40%;background:blue;display:table-cell;} 
.one {width:30%;background:green;display:table-cell;} 
#wrapper {display:table;width:100%;} 
</style> 
</head> 
<body> 
<div id="wrapper"> 
<aside> 
<div style="height: 100px; width: 100px; border: 2px solid orange;"> 

</div><!--/--> 
</aside> 
<section class="two"> 
Text 
</section> 
<section class="one"> 
Text 
</section> 
</div> 
</body> 
</html> 

下面是代碼的的jsfiddle:http://jsfiddle.net/jtmkrueger/Aza47/將div設置爲顯示問題:table-cell;

我怎樣才能在單元格中的內容總是被valigned在這種情況下,頂部?請注意,第二個和第三個框中的「文本」被壓下...

回答