On the usage of CSS common pseudo-class

Source: Internet
Author: User

Focus on the use of After and before:

How to become

The above directory structure is generated by jstree, we know that there is no tag behind, how to generate it?

Very simple, only CSS style can be done: tag element + pseudo-class after

a.task-pack:after{//My style name is this, you can write your own style name
Content: ' Packaged ';
Display:inline-block;
min-width:10px;
PADDING:3PX 7px;
margin-left:2px;
font-size:12px;
Font-weight:bold;
Color: #fff;
Line-height:1;
Vertical-align:middle;
White-space:nowrap;
Text-align:center;
Background-color: #009bdb;
border-radius:10px;
}

Sometimes it can be used to bind to a checkbox, and if we want to make a tick check box, it can be changed.

CSS3 Brother selector: Input:checked+label:after{css style}, as long as it is selected, the label label will have a corresponding style changes;

Before is placed in front of the element, and usage is similar to after

On the usage of CSS common pseudo-class

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.