HTML and CSS Reference
In-Depth Information
The page URL targets the <div> when the link is clicked. To style it in this state,
you could use this:
div:target {
.
}
Note that you can see a real working example of CSS-only tabs using :target
inside the target-demo folder in the chapter1 code download folder.
New pseudo-classes are also available for styling form inputs when the data
is valid and invalid (see Chapter 2 for more about HTML5 forms). Funnily enough,
they are:
input:valid { color: green; }
and
input:invalid { color: red; }
:nth-child allows you to select a repeating pattern of elements inside a con-
tinuous series—for example, several list items or several paragraphs or articles
next to one another. Let's look at an example:
<ul>
>
>
>
>
>
>
>
>
>
>
</ul>
 
Search WWH ::




Custom Search