CSS pseudo-class and Pseudo-object selection (V)

Source: Internet
Author: User

I. Pseudo Selector

Pseudo-selectors include: pseudo-class selectors and pseudo-object selectors, prefixed with a colon (:), followed by a pseudo-class or pseudo-object name, with no spaces before or after the colon, otherwise resolved to include selectors

Such as:

Div:hover { font-size:12px;} /* Div for the specified tag name hover selector, pseudo-class or pseudo-element name */

Pseudo-selectors are specifically designed to select elements or objects in special areas or in special states that are not precisely controlled by tag selectors, ID selectors, or class selectors.

Second, pseudo-class selectors and pseudo-object selectors
Pseudo class Description
: Focus Defines the style of an object when it becomes the input focus (when the onfocus event of the object occurs)
: First-child Defines the style of the first child object of an object
: First Defines the style used on the first page of a shale container, only applicable to @page rules
: Left Defines the style used by all pages on the left side of the gutter, only for @page rules
: Right Defines the style used by all pages on the right side of the gutter, only for @page rules
: lang Defines the content style of an object using a special language

Pseudo-Object Description
: After Used with the content property to define what is behind the object
: Before Used with the content property to define what is in front of the object
: First-letter Defines the style of the first character within an object
: First-line Defines the style of the first row within an object
Third, hyperlinks
@charset "Utf-8";/*CSS Document*//*hyperlink Default Style*/a{text-decoration:None;Color:#333333;}/*Styles visited*/a:visited{Color:#0000ff;}/*Mouse over style*/a:hover{Color:#00ff00;}/*Mouse down Style*/a:active{Color:#FF0000;

There is one more: Link can define a hyperlink style that has not been visited, and you can use a selector instead of the A:link selector style.

Link and: Visited called Link pseudo-class, can only be applied to anchor elements;

: Hover,:active and: Focus is called dynamic Pseudo-class and can theoretically be applied to any element.

CSS pseudo-class and Pseudo-object selection (V)

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.