HTML and CSS Reference
In-Depth Information
Because you know that the first paragraph of every post immediately follows
an h1 tag, you can refer to the h1 on your selector.
GENERAL SIBLING COMBINATOR
The general sibling combinator works pretty much the same as the adjacent
sibling combinator, but with the di " erence that the second selector doesn't
have to immediately follow the first one.
So if you need to target all the p tags that are within a particular div and
that follow the h1 tag (you may want those p tags to be larger than the ones
that come before the title of your post), you can use this selector:
.post h1 ~ p {
font-size: 13px;
}
Notes on browser support
Internet Explorer 6 doesn't understand sibling combinators, but, as for the
other cases, if your audience includes a small percentage of IE6 users, and if
the website's layout isn't broken or severely a " ected by its lack of support,
this is a much easier way of achieving lots of cool e " ects without the need
of cluttering your HTML with useless classes and ids.
4. Pseudo-classes
DYNAMIC PSEUDO-CLASSES
These are called dynamic pseudo-classes because they actually do not exist
within the HTML: they are only present when the user is or has interacted
with the website.
Search WWH ::




Custom Search