【发布时间】:2014-01-05 14:00:52
【问题描述】:
我使用 Arve Systad 给出的答案(第 3 个答案:flow 2 columns of text automatically with css)来构建以下示例(更大文件的一部分):
<!DOCTYPE html>
<html>
<head>
<style>
#container {
width: 100%;
margin: 0 auto;
}
div#container p {
text-align: left;
float: left;
width: 25.3%;
margin: 2%;
padding: 0px 2% 10px 2%;
height: 500px;
background-color: yellow;
}
.columnh2 {
line-height: 200%;
font-weight: bold;
}
</style>
</head>
<body>
<div id="container">
<p><span class="columnh2">Title of a text</span><br />
A few lines of text<img src="example.png" border="0" width="81" height="80" /></p>
<p><span class="columnh2">Title of 2nd text</span><br />
More text with a different subject</p>
<p><span class="columnh2">Title of 3th text</span><br />
And more text with yet another subject</p>
</div>
</body>
</html>
第一列中有一张图片(第二列和第三列也会有),但目前定位不正确。我已经包含了一个 picture 我想要它,但我无法让它与 CSS 一起使用。
我该如何解决?
【问题讨论】: