self_example/java_web/CSS/html/03-CSS选择器.html

39 lines
560 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>03-css选择器</title>
<!-- 所选区域范围越小谁就生效id>class>div-->
<!--元素选择器-->
<style>
div {
color: red;
}
#name {
color: blue;
}
.cls{
color: pink;
}
</style>
<!-- id选择器-->
<!-- 类选择器-->
</head>
<body>
<div>div1</div>
<div id="name">div2</div>
<div class="cls">div3</div>
<span class="cls">span</span>
</body>
</html>