为什么这样用子类选择器就没有办法不显示文字了
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>none</title>
<style type="text/css">
.no>p {
display:none;
}
</style>
</head>
<body>
<p>我爱学习,我爱慕课网</p>
<p class="no">我爱学习,我爱慕课网</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>none</title>
<style type="text/css">
.no>p {
display:none;
}
</style>
</head>
<body>
<p>我爱学习,我爱慕课网</p>
<p class="no">我爱学习,我爱慕课网</p>
</body>
</html>
2021-12-03
举报