asp.net - 我怎样才能把它变成一个div

标签 asp.net html css

我怎样才能在一个 div 中制作这个?目前它有两个 div,但我需要将它放在一个 div 中,就像左侧显示的图像和右侧显示的文本一样。

<div style='float: left; margin-left: 6px; margin-bottom: 6px; height: 191px;'>
    <img src='http://www.cnn.com/features/150px.jpg' width='100' height='100' border='0' alt='Lipsum' />
    <br /> 
    <img src='http://www.cnn.com/features/b150px.jpg' width='100' height='100' border='0' alt='Lipsum' />
    <br />
    <br />
    <br />
</div>
<div id='lipsum'>
    <p>first paragraph</p>
    <p>second paragraph</p> 
</div>

最佳答案

你可以使用clear: left:

参见: http://jsfiddle.net/thirtydot/FN4h4/

CSS:

img {
    float: left;
    clear: left;
    margin: 0 6px
}

HTML:

<div id='lipsum'>

    <img src='http://www.cnn.com/features/150px.jpg' width='100' height='100' border='0' alt='Lipsum' />
    <img src='http://www.cnn.com/features/b150px.jpg' width='100' height='100' border='0' alt='Lipsum' />

    <p>Lorem ipsum..</p>
    <p>Lorem ipsum..</p>
</div>

关于asp.net - 我怎样才能把它变成一个div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5964779/

相关文章:

asp.net - 使用 Javascript 将附加参数传递到 LinkBut​​ton 的 OnClick 事件处理程序

javascript - 如何在异步方法asp net中显示警报

javascript - 在 Visual Studio 2015 中,有没有办法使用 Internet Explorer 以外的浏览器调试 Javascript?

javascript - 使用 php 和 mysql 表单上的多个搜索字段

asp.net - itextsharp文件没有页面

javascript - 如何从 indexeddb 中获取所有值

鼠标悬停时姐妹 div 的 JavaScript style.height

jquery - Bootstrap - 平板电脑 View - 文本/图像位置

CSS 箭头 : how is the arrow's tail drawn?

javascript - 在加载时使用 javascript 添加样式属性