CSS :first-child pseudo-class
Complete CSS Reference
Definition
The :first-child pseudo-class adds a special style to an element that is the first child of some other element.
Note: For :first-child to work in IE a
<!DOCTYPE> must be declared.
Example 1 - Match the first <p> element
In the following example, the selector matches any <p> element that is the first child
of any element:
<style type="text/css">
p:first-child
{
color:blue
}
</style>
<p>I am a strong man.</p>
<p>I am a strong man.</p>
|
Try it yourself!
Example 2 - Match the first <i> element in all <p> elements
In the following example, the selector matches the first <i> element
in all
<p> elements:
<style type="text/css">
p > i:first-child
{
color:blue
}
</style>
<p>I am a <i>strong</i> man. I am a <i>strong</i> man.</p>
<p>I am a <i>strong</i> man. I am a <i>strong</i> man.</p>
|
Try it yourself!
Example 3 - Match all <i> elements in all first child <p>
elements
In the following example, the selector matches all <i> elements in
<p> elements that are the first child of another element:
<style type="text/css">
p:first-child i
{
color:blue
}
</style>
<p>I am a <i>strong</i> man. I am a <i>strong</i> man.</p>
<p>I am a <i>strong</i> man. I am a <i>strong</i> man.</p>
|
Try it yourself!
Complete CSS Reference
Learn how your website performs under various load conditions
 |
|
WAPT
is a load, stress and performance testing tool for websites and web-based applications.
In contrast to "800-pound gorilla" load testing tools, it is designed to minimize the learning
curve and give you an ability to create a heavy load from a regular workstation.
WAPT is able to generate up to 3000 simultaneously acting virtual users using standard hardware configuration.
Virtual users in each profile are fully customizable. Basic and NTLM authentication methods are supported.
Graphs and reports are shown in real-time at different levels of detail, thus helping to manage the testing process.
Download the free 30-day trial!
|
|