选择另一个元素之后的第一个出现的元素
问题描述:
我在页面上有以下HTML代码:
I've got the following HTML code on a page:
<h4>Some text</h4>
<p>
Some more text!
</p>
在我的.css
中,我具有以下选择器来设置h4
元素的样式.上面的HTML代码只是整个代码的一小部分;有更多div
包裹着一个影子箱:
In my .css
I've got the following selector to style the h4
element. The HTML code above is just a small part of the entire code; there are several div
s more wrapped around belonging to a shadowbox:
#sb-wrapper #sb-wrapper-inner #sb-body #myDiv h4
{
color : #614E43;
margin-top : 5px;
margin-left : 6px;
}
因此,我的h4
元素具有正确的样式,但我也想在HTML中设置p
标记的样式.
So, I have the correct style for my h4
element, but I also want to style the p
tag in my HTML.
使用CSS选择器可以吗?如果是的话,我该怎么办?
Is this possible with CSS-selectors? And if yes, how can I do this?