我想知道在这样的文字上插入图像最好的方法是什么? http://i.imgur.com/PRBEoLE.png 我应该只将文本的顶部浮动到两者。左下方的底部图像和右侧的底部文本还是有更好的方法吗?
答案 0 :(得分:1)
首先,图像是内联元素。您只需将图像浮动到任何部分(右/左),然后指定适当的边距以使其从文本中清除。
p img {
float: left;
margin: 15px 15px 15px 0;
}
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' <img src="http://www.modernartframing.com.au/images/video-icon.jpg" alt="img"/> will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>