Correcting teacher:天蓬老师
Correction status:qualified
Teacher's comments:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
h1 {
color : blue;
}
h1 {
color : red;
}
</style>
</head>
<body>
<h1>hello world</h1>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
#one {
background-color: red;
}
.one {
background-color: blue;
}
.two {
background-color: blue;
}
ul li {
background-color: darkcyan;
}
</style>
</head>
<body>
<ul>
<li class="one" id="one">item1</li>
<li class="two" id="two">item2</li>
<li>item3</li>
<li>item4</li>
<li>item5</li>
</ul>
</body>
</html>
此处可以看到结论
所以最后的结论是
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
@import "css/css1.css";
</style>
</head>
<body>
<h1>
hello world!
</h1>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="css/css1.css">
</head>
<body>
<h1>
hello world!
</h1>
</body>
</html>
css
css1
.my_form :only-of-type {
background-color: darkcyan;
}
.index :nth-of-type(2) {
color:red;
}
css2
.index :first-of-type {
color: darkcyan;
}
.index :last-of-type {
color: blue;
}
css3
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
@import "main.css";
</style>
</head>
<body>
<nav class="index">
<a href="">商品详情</a>
<a href="">商品列表</a>
<a href="">个人中心</a>
</nav>
<form class="my_form" style="display: grid; gap: 1rem">
<input type="text" placeholder="Username">
<input type="password" placeholder="Password">
<input type="email" placeholder="demo@email.com">
<button>提交</button>
</form>
</body>
</html>