12_CSS相接選取器_相鄰選取器
12_CSS相接選取器_相鄰選取器
css file
div + p {
color: red;
}
p + div {
color: green;
}
|
html file
<html>
<head>
<title>網頁標題</title>
<linkrel="stylesheet"type="text/css"href="01.css">
</head>
<body>
Choice. The problem is choice.
<p>Free your mind.</p>
<div>Believe the unbelievable.</div>
<p>There is no spoon.</p>
<p>Because I choose to.</p>
</body>
</html>
|