1.基本选择器

1.标签选择器
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
h1{
color: rgba(0, 102, 78, 0.99);
}
p{
color: darkcyan;
background: brown;
shape-image-threshold: inherit;
size: A4;
}
</style>
</head>
<body>
<h1>java</h1>
<h1>java</h1>
<p>c++</p>
</body>
</html>
2.类选择器

<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
/*类选择器格式 .class的名称*/
.hello{
color: brown;
}
.yellow{
color: blue;
}
</style>
</head>
<body>
<h1 class="hello">标题1</h1>
<h1 class="yellow">标题1</h1>
<h1 class="hello">标题1</h1>
</body>
</html>
3.id选择器
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
/*<!--id 选择器
#id名称{
}
-->*/
#hello{
color: brown;
}
</style>
</head>
<body>
<h1 id="hello">标题1</h1>
<h1>标题1</h1>
<h1>标题1</h1>
<h1>标题1</h1>
<h1>标题1</h1>
</body>
</html>
 
 
posted @ 2022-07-25 17:57  吾辈皆喜黑丝  阅读(24)  评论(0)    收藏  举报