In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what are the pseudo-classes in html". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the pseudo-classes in html".
In html, a pseudo class is a selector used to add a corresponding style to an existing element when it is in a certain state (slide, click, etc.), and the state changes dynamically according to the user's behavior. The common pseudo classes are ": active", ": hover", ": link", ": root", ": valid", and so on.
The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.
Pseudo class: used to add a corresponding style to an existing element when it is in a certain state (slide, click, etc.), which changes dynamically according to the user's behavior.
My understanding is that css can be used to modify objects in a state that does not exist in itself and can only be triggered in a specific situation (slide, click).
For example, when a user hovers over a specified element, the state of this element can be described by: hover. Although it is similar to general css and can add styles to existing elements, it can add styles to elements only when it is in a state that the DOM tree cannot describe, so it is called pseudo-class.
The common pseudo classes are:
: active selects the element being activated (matches the specified state)
: hover selects the element hovering by the mouse (matches the specified state)
: link selects elements that are not accessed (matches the specified state)
: visited selects the element that has been accessed (matches the specified state)
First-child selects an element that satisfies the first child of its parent element
: lang (value) Select the element with the specified lang attribute
Focus selects elements that have keyboard input focus
: enable selects each started element
Disable selects each prohibited element
: checked selects each selected element
: target selects the current anchor element
First-of-type selects an element that satisfies the first type of child element of its parent element
Last-of-type selects an element that satisfies the last type of child element of its parent
: only-of-type selects an element that satisfies the only child element of a certain type of parent element
: nth-of-type (n) Select an element that satisfies the nth child element of a certain type that is its parent
: nth-last-of-type (n) Select the element of some type that satisfies the last but one of its parent element
Only-child selects an element that satisfies the only child of its parent element
: last-child selects an element that satisfies the last element of its parent
: nth-child (n) Select an element that satisfies the nth child of its parent element
: nth-last-child (n) Select an element that satisfies the nth penultimate child of its parent
Empty selects elements that satisfy elements that have no child elements
In-range selects elements with satisfactory values within the specified range
: out-of-range selects elements whose values are not within the specified range
Invalid selects elements whose satisfaction values are invalid values
Valid selects elements whose satisfaction values are valid values
: not (selector) Select elements that do not meet selector
: optional selects form elements that are optional, that is, there is no "required" attribute
Read-only selects a form element with "readonly"
: read-write selects form elements that do not have "readonly"
: root select root element
Thank you for your reading, these are the contents of "what are the pseudo-classes in html". After the study of this article, I believe you have a deeper understanding of what the pseudo-classes in html have, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.