<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<style>
.child{
display: none;
}
/* 父亲鼠标悬停的时候孩子会... */
.father:hover .child{
color: red;
display: block;
}
</style>
<div class="father">
I love you.
<p class="child">Me too.</p>
</div>
</body>
</html>
css伪类选择器实现颜色的display动态改变(css的强大)
最新推荐文章于 2022-06-18 11:47:26 发布
