:first-line
In this chapter you will learn:
Description
The :first-line
selector adds a style to
the first line of the specified selector.
Example
<!DOCTYPE html><!-- ja v a2 s .c o m-->
<html>
<head>
<style>
p:first-line{
background-color:red;
}
</style>
</head>
<body>
<p>This is a paragraph. This is a paragraph. This is a paragraph.
This is a paragraph. This is a paragraph. This is a paragraph.
This is a paragraph. This is a paragraph. This is a paragraph.
This is a paragraph. This is a paragraph. This is a paragraph. </p>
</body>
</html>
Next chapter...
What you will learn in the next chapter:
- Definition for Selector :first-child
- An example showing how to use :first-child CSS selector
- How to combine :first-child with other selectors
Home » HTML CSS Tutorial » CSS Selector Reference