Set the CSS style for the element behind an element:
Syntax: Previous + next.
Function: You can select an element next to the specified sibling element immediately after it.
Sets the CSS style for all the same elements that are behind an element:
Syntax: previous ~ all behind.
<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "UTF-8"> <title></title> <styletype= "Text/css">H1 + P{Background-color:Orange; }span ~ P{Background-color:Green;Color: White;Font:"Courier New"; } </style> </Head> <Body> <H1>I am a h1 tag</H1> <P>I am a P tag</P> <P>I am a P tag</P> <P>I am a P tag</P> <P>I am a P tag</P> <P>I am a P tag</P> <P>I am a P tag</P> <span>I am a span</span> <P>I am a P tag</P> <P>I am a P tag</P> <P>I am a P tag</P> <ahref= "Http://www.baidu.com">Baidu</a> <P>I am a P tag</P> </Body></HTML>
Effect:
Front-end learning--CSS--Brother element Selector