How to use property selectors and pseudo class selectors

Source: Internet
Author: User
Today we will tell you about the use of the property selector and pseudo-class selector and related links and differences, let's give you a small example.

Property selector:

[attr~= "value"] word word space word Word must value valid

[attr|= "value"] value beginning or value-word

Attention:

The choice of attributes is very difficult to judge the selection element by the regular expression, the efficiency is higher

Pseudo-Class selectors:

: Before

: After

: Lang (val) val/val-words

: Nth-child (N) n calculates the odd cardinality even the even number starting from 1

: the Nth-of-type (n) selector matches each element of the nth child element of a particular type that belongs to the parent element.

<!doctype html>

Related reading:

How to hide the contents of an overflow div

What are the techniques of CSS layout?

How to set the font style in CSS

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.