CSS: After and: What is the role of before:
In the current page layout: The After and: Before pseudo-object selectors don't seem to be used very often, as the low version of IE does not support it, but it also clears the floats or all other related layouts that have their application. However, as the low-version browser usage decreases, the frequency of their occurrence should increase correspondingly. Here is a brief introduction to the use of these two pseudo-object selectors, first look at a code example:
<!DOCTYPE HTML> <HTML> <Head> <MetaCharSet= "Utf-8"> <Metaname= "Author"content= "http://www.51texiao.cn/" /> <title>Ant Tribe</title> <styletype= "Text/css">Div:before{content:"added content"; } </style> </Head> <Body> <Div>|div the original content</Div> </Body> </HTML>
The above code can add the specified content to the inner front of the div element. Of course: The Before pseudo-object selector is implemented in conjunction with the content property.
Syntax structure:
E:before {}e::before{}
E represents elements that are matched with selectors, for example:
Div:before.first:before#mytest:before
In the syntax can be seen there are two grammatical forms, one is before in front of a ":", one is before front there are two ":", the first is the CSS2, the second is the writing of CSS3. IE7 and IE7 below do not support CSS2 notation, IE8 and IE8 the following browsers do not support the wording of CSS3. : Before pseudo-object selectors general and content properties are used in conjunction with adding the specified content to the front end of the specified matching element. : After pseudo-object selectors are used in the same way as: Before is the same, not introduced.
The original address is: http://www.51texiao.cn/div_cssjiaocheng/2015/0501/507.html
CSS: After and: What is the role of before