Home>Article>Web Front-end> What is the css target pseudo-class?
In css, the target pseudo-class is ":target", and the syntax format is "E:target{css style}", which means that all elements matching E are selected, and the matching elements are pointed to by the relevant URL; this selection The selector is a dynamic selector, and the style effect can only be effective when there is a URL pointing to the matching element.
(Recommended tutorial:CSS video tutorial)
In css, the target pseudo-class selector is ": target" is one of the many dynamic pseudo-class selectors in CSS3, used to match the element pointed to by the anchor and highlight the active HTML anchor.
Syntax:
E:target{css样式}
means to select all elements matching E, and the matching elements are pointed to by the relevant URL. This selector is a dynamic selector, and the style effect will only be effective when there is a URL pointing to the matching element. The process of "
:target" taking effect in CSS is as follows: when the hash in the browser address (the part after the # sign in the address) matches the ID specified by the :target pseudo-selector, it The style will take effect on this ID element.
Example:
Rendering:
Note: IE8 and below This version of the browser does not support the E:target selector
For more programming-related knowledge, please visit:Programming Learning Website!!
The above is the detailed content of What is the css target pseudo-class?. For more information, please follow other related articles on the PHP Chinese website!