CSS: before selector
CSS selectors complete reference manual
Definition and description
: Before selector to the currently selected element insertions.
Use the content attribute to specify the content to be inserted.
Browser Support
Figures in the table represent the first browser to support the version number of the property.
选择器 | |||||
---|---|---|---|---|---|
::before | 4.0 | 9.0 部分从8.0 |
3.5 | 3.1 | 7.0 部分从 4.0 |
Note: before running IE8, you must declare <DOCTYPE!> .
related articles
CSS tutorial: CSS Pseudo-Elements
CSS Selector Reference: CSS: the After selectors
More examples
Examples
In each <p> before inserting the content and style:
p: before
{
content: "Read this -";
background-color: yellow;
color: red;
font-weight: bold;
}
{
content: "Read this -";
background-color: yellow;
color: red;
font-weight: bold;
}
try it"
CSS selectors complete reference manual