CSS / HTML:左侧有文字

时间:2010-11-03 11:53:59

标签: html css

<span style='float: left; margin: 10px; width: 60px; display: block;'>
<img style='border: 1px solid #FFF; width: 61px; height: 80px;' src='images/profilePhoto/thumbs/86.jpg'>
<br>
<a href='profil.php?id=86'>Megan F.</a>
<br><br>
</span>
<div style='margin-left: 90px;'>
<h1>(inget ämne)</h1>
<div>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec fringilla urna eget urna euismod aliquet. Duis porta volutpat blandit. Phasellus bibendum bibendum porta. Nunc molestie tristique leo, sed euismod orci ultricies vitae. Mauris non libero a leo ultricies laoreet. Suspendisse luctus urna vel sapien tristique vitae semper nulla eleifend. Integer congue aliquam pharetra. Phasellus diam neque, tincidunt vel elementum vel, ornare sit amet mi. Nulla tincidunt purus in odio vulputate mollis. Nunc urna odio, rutrum eu ultricies a, facilisis ullamcorper nunc. In purus velit, varius vel laoreet eu, tincidunt non purus. Nulla facilisi. Sed ac lectus nibh. Praesent non velit nibh.<br />
... 
</div>

这就是我现在所拥有的: http://img192.imageshack.us/img192/7857/applytext.png

如何在图像中显示文字?

1 个答案:

答案 0 :(得分:0)

如果您希望新文本与第二段垂直对齐,则添加

<div style="clear: both"></div>

在第二段之前,然后像你原来那样做另一个浮动。

如果您只想在左侧浮动整个面板,那么您只需将其添加到浮动内容即可。但看起来你的新文本与第二段垂直对齐,所以上面列出的方法就是它。