目前,我有我的HTML,看起来有点像这样的组成部分。这是一个简化版本。CSS - 股利不会算子格
<div id="content">
<div id="screenshot">
<img src="res/screenshot.png" />
</div>
<div id="introduction">
<p>This is just some text</p>
</div>
</div>
而我的CSS看起来像这样。
#content {
position: absolute;
top: 0;
left: 0;
height: 100%;
background: blue;
}
#screenshot img {
padding-top: 10px;
padding-bottom: 10px;
float: left;
}
#introduction {
position: relative;
top: -100%;
left: 200px;
width: 500px;
height: 100%;
}
而且我的问题是在于“背景:蓝色;”只选择图像,但不包裹文字。顺便说一句,我知道我怎么可以把文本背景的蓝色,但我需要通过#content
做到这一点。如果它可以帮助,#content
的母公司是在这个CSS。 基本上,我需要的是,如果我做一些事来#content
,它会影响孩子的div。它目前仅影响#screenshots
。 :/
#content-wrapper{
position: absolute;
width: 100%;
height: 340px;
left: 0;
top: 50%;
margin-top: -170px;
}
感谢,zeokila
编辑:我需要的是,如果我做一些事来#content
,它会影响孩子的div。它目前仅影响#screenshots
。 :/
谢谢,这解决了我的问题。对不起,我没有解释太多,我不知道如何,但它解决了我。 – 2012-08-05 17:32:14
不用担心。很高兴工作! – 2012-08-05 17:33:27