早期版面常將廣告置於左上,內容隨之流至廣告下方。若資料較短,使用者易忽略。改用左右分欄可讓側邊廣告與主內容並列,提升可見度。
父容器不設寬度(或設 100%),子容器分別 float: left 並指定百分比寬度:
#exhibitor114 { margin: 0 auto; width: 100%; }
#exhibitorleft { float: left; width: 44%; background: #eee; }
#exhibitorright { float: left; width: 56%; }
<!DOCTYPE html>
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>左右分欄示範</title>
<style type="text/css">
#exhibitor114 { margin: 0 auto; width: 100%; }
#exhibitorleft { float: left; width: 44%; height: 100%; background: #eeeeee; }
#exhibitorright { float: left; width: 56%; height: 100%; }
</style>
</head>
<body>
<div id="exhibitor114">
<div id="exhibitorleft">左側內容(如廣告)</div>
<div id="exhibitorright">右側主內容</div>
</div>
</body>
</html>
overflow: hidden 或 clearfix),否則高度塌陷。