2 CSS 中盒子内有盒子
我希望有人能为我提供一个有效的 css,它可以将 2 个盒子放入一个盒子中。 就像我给出的图像
CSS
<style type="text/css">
#adbox {
width: 602px;
height: 250px;
border-width: 0;
border-color: red;
}
#adbox .adbox1 {
width: 300px;
height: 250px;
border-width: 0;
border-color: red;
}
#adbox .adbox2 {
width: 300px;
height: 250px;
border-width: 0;
border-color: red;
}
</style>
HTML
<div align=center><div id="adbox">
<div class="adbox1">
<img src="foobar1.jpg" border="0" />
</div>
<div class="adbox2">
<img src="foobar.jpg" border="0" />
</div>
</div></div>
I would like some one to provide me with a valid css which can put 2 Boxes inside a box.
like in the image I have given
CSS
<style type="text/css">
#adbox {
width: 602px;
height: 250px;
border-width: 0;
border-color: red;
}
#adbox .adbox1 {
width: 300px;
height: 250px;
border-width: 0;
border-color: red;
}
#adbox .adbox2 {
width: 300px;
height: 250px;
border-width: 0;
border-color: red;
}
</style>
HTML
<div align=center><div id="adbox">
<div class="adbox1">
<img src="foobar1.jpg" border="0" />
</div>
<div class="adbox2">
<img src="foobar.jpg" border="0" />
</div>
</div></div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我猜您想像您提供的图像中那样对齐框。
您可以使用以下 css 来执行此操作:
示例:http://tinkerbin.com/5MAX3Mt2
I'm going to guess that you want to align the boxes like in the image you provided.
You can do this with this css:
Example: http://tinkerbin.com/5MAX3Mt2
嗯..你没有问这个问题....我假设你想将两个盒子并排放置,我根据我的假设提供答案。如果您想将两个框并排放置,请按如下方式更改 html 和 css
另请注意“clear”类的用法,该类会清除浮动
html
CSS
Well..You didn't ask the question....I am assuming that you want to place the two boxes side by side and I am providing answer based on my assumption. Change your html and css as below if you want to place the two boxes side by side
Also note the usage of "clear" class which clears the floats
html
CSS