The role of the plus (+) adjacent selector in CSS code

Source: Internet
Author: User

The function of the plus (+) adjacent selector in the CSS code:
This section describes the role of adjacent selectors in CSS, which is represented by a plus sign (+).
This selector can match the sibling element immediately preceding the selector.
code example:

<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.softwhy.com/" /><title>Ant Tribe</title><styletype= "Text/css">input[type=radio]:checked + span{background:Blue;}input[type=radio]:checked + span:after{content:"Ant tribe [Url=]2[/url]";}</style></Head><Body><formMethod= "POST">  <fieldset>    <legend>Select the item below to try</legend>    <ul>      <Li><label><inputtype= "Radio"name= "Colour-group"/><span>Blue</span></label></Li>      <Li><label><inputtype= "Radio"name= "Colour-group"/><span>Red</span></label></Li>      <Li><label><inputtype= "Radio"name= "Colour-group"/><span>Black</span></label></Li>    </ul>  </fieldset></form></Body></HTML>

The code above demonstrates the role of this selector, and more can be found in related readings.
Related reading:
1. Adjacent selectors can refer to the adjacent selector (e+f) section of the CSS .
2.:checked pseudo-class selectors can be found in the e:checked section of the CSS pseudo-class selector .
3.:after pseudo-element selectors can be found in the E:after/e::after section of the CSS pseudo-object selector .

The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=15644

For more information, refer to: http://www.softwhy.com/divcss/

The role of the plus (+) adjacent selector in CSS code

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.