CSS ~ and +

Source: Internet
Author: User

I used to think that CSS is not how bad, today suddenly found ...

Cough.. Cough..

The following is a tested Oh ^_^

Of course not so comprehensive, welcome suggestions!

Ok

~ (not found in China)

Function: At the back of the same level

Like what:

1 <spanclass= "T">Top</span>2 <Div>3     <spanclass= "T">Inside</span>4 </Div>5 <spanclass= "T">Number 1th below.</span><BR/>6 <spanclass= "T">Number 2nd below.</span>

Now let's add a style to him: div~. t{color: red;}

So who's going to change? Yes, that's right: the bottom 1th and number 2nd are red.

+

function: To be followed at the same level (must be followed)

If we change the style to: . t~. t{color:red;}

Who changed?

The answer is, the wood has ... Because there is no element chain that conforms to this rule

Now, remove the <br/> from the HTML code

RUN!

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.