CSS pseudo-class content generation

php中世界最好的语言
Release: 2018-03-07 15:02:32
Original
1535 people have browsed it

This time I will bring you the pseudo-class content generation of CSS, what are the notes of CSS pseudo-class content generation, the following is a practical case, let’s take a look.

1. Add new text (picture) content to existing elements through css
Selector:
1. :before
To Add the generated content before the matching element
Position to the beginning of the matching element
2. :after
Add the generated content after the matching element

eg:

div:before{}
p:after{}
Attribute:

1. content
Function: insert the generated content div with :before, :after pseudo-elements :before{
content:"Generated content:";
}
Common values:
String: Ordinary text
url:Image
Counter ;

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Related reading:

What should I do if the browser is not compatible with the code I wrote

2018 latest front-end interview questions 11

The above is the detailed content of CSS pseudo-class content generation. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!