Contents of this chapter
1. Mission objectives
We learned about html comments before, not only html has comments but css also has comments. Notes are very common in our English and classical Chinese.
2. CSS comments
code show as below
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.box {
/* 设置背景颜色和字体颜色 */
background-color: blue;
color: chartreuse;
}
</style>
</head>
<body>
<div class="box">
君不见黄河之水天上来
奔流到海不复回
</div>
</body>
</html>
The effect is as follows
3. Summary
We can see that adding comments in the code cannot be displayed on the web page. We must learn to use comments and develop the habit of using comments.