You cannot make up for it ~ Several pseudo elements in CSS

Source: Internet
Author: User

For a good editor VS, It is very powerful for the automatic prompt function of programming statements. Sometimes, we do not need to look at the relevant APIs at all, directly looking at the prompts provided by VS, we can learn a new technology.

Today, we are talking about several pseudo elements in CSS. They are not used in project development, but they are really useful. They are not used in projects because they are hard to be understood, the following is a work scenario. For example, there are four buttons: create, edit, delete, and modify. We require that the Chinese characters displayed on the foreground be unified. If you want to change them, all of them need to be changed. For example, if we want to change the build to "new", all the builds should be changed to new ones, but the amount of code is not small. Of course, if you write <a> Create </a> in this way, it is quite troublesome. What if you use pseudo elements? See the following code: <a class = "create"> </a>, and "create" is displayed on the page, which is implemented by pseudo elements.

Add specified content before and after an element

{:;}{:;}{:;}{:;}

HTML call code

 

Page display

2. Add the specified style to the first element of the Element Set

 
 
{:;:;:;}

HTML call code

 

Page display

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.