# css相鄰選擇器 <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <TITLE>類別選擇器的種類 </TITLE> <STYLE> /* 共用類別選擇器,可以套用在不同的元素標籤 */ .title { color : deepPink } /* 定義title共用類別 */ /* 設定相鄰選擇器的樣式(adjacent sibling selector):h3元素外緊接i元素*/ h3+i { color : blue; } </STYLE> </HEAD> <BODY> <H3 class="title">可定義相鄰選擇器</H3> <h3>相鄰選擇器</h3> <i>可套用相鄰選擇器</i><br> <!-- 可以套用相鄰選擇器:h3+i --> <i>不能套用相鄰選擇器</i><br> <!-- 不能套用相鄰選擇器:h3+i --> </BODY> </HTML>
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up