:before
In this chapter you will learn:
Description
The :before
selector inserts content before
the content of the selected elements.
Example
<!DOCTYPE html><!--from jav a 2s.c om-->
<html>
<head>
<style>
p:before{
content:"added before";
}
</style>
</head>
<body>
<p>this is a paragraph.</p>
</body>
</html>
Next chapter...
What you will learn in the next chapter:
- Definition for Selector :after
- An example showing how to use :after CSS selector
- How to add content after list item
- How to add after content for a class
Home » HTML CSS Tutorial » CSS Selector Reference