<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
#left_wrapper {
width: 33%;
float: left;
position: relative;
}
#middle_wrapper {
width: 33%;
float: left;
position: relative;
}
#right_wrapper {
width: 33%;
float: left;
position: relative;
}
#left {
padding: 10px 60px;
}
#right {
padding: 10px 60px;
}
#middle {
padding: 10px 60px;
}
</style>
</head>
<body>
<div id="left_wrapper">
<div id="left">
<p>This is the left text : This is the left text :
This is the left text : This is the left text :
This is the left text : This is the left text :
This is the left text : This is the left text :
</p>
</div>
</div>
<div id="middle_wrapper">
<div id="middle">
<p>This is the middle text : this is the middle text
This is the middle text : this is the middle text
This is the middle text : this is the middle text
This is the middle text : this is the middle text
This is the middle text : this is the middle text
</p>
</div>
</div>
<div id="right_wrapper">
<div id="right">
<p>This is the right text : This is the right text
This is the right text : This is the right text
This is the right text : This is the right text
This is the right text : This is the right text
</p>
</div>
</div>
</body>
</html>
ラッパーはツリー列を定義しますが、他の div ( left、right、middle ) を使用すると操作が簡単になります。
パディングを使用して列間にスペースを追加できますが (コード例で追加したように)、パディングはラッパーではなく新しい div に適用されます。
実際に div を列に分割する別の方法があります。
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.newspaper
{
-moz-column-count:3; /* Firefox */
-webkit-column-count:3; /* Safari and Chrome */
column-count:3;
}
</style>
</head>
<body>
<p><b>Note:</b> Internet Explorer does not support the column-count property.</p>
<div class="newspaper">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius.
</div>
</body>
</html>
(お役に立ててよかったです)