What is the role of the CSS selector plus +?

Source: Internet
Author: User

What is the function of the CSS selector Plus +:
This selector matches the sibling element immediately following the specified element.
The code example is as follows:

<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.softwhy.com/" /><title>Ant Tribe</title><styletype= "Text/css">#items{width:900px;Height:Auto;margin:0 Auto;padding:5px 0;Clear:both;}#items ul, #items Li{List-style:None;}#items Li{width:500px;Height:28px;text-align: Left;Padding-left:0px;Line-height:28px;Border-bottom:dashed 1px #CCC;cursor:Pointer;}. First + li{Color:Red;}</style></Head><Body><DivID= "Items">  <ul>    <Liclass= "First">Ant Tribe welcome you, only struggle to have a better future</Li>    <Li>No one is a master at first, must study hard</Li>    <Li>The URL address of this site is softwhy.com</Li>    <Li>Every day is new, so be true. Current time</Li>    <Li>There's a lot of detailed code in the div CSS Tutorial.</Li>  </ul></Div></Body></HTML>

The code above can set the font color of the first LI element immediately following the LI element with the class property value to red.

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

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

What is the role of the CSS selector plus +?

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.