css怎么设置悬停效果后不影响旁边其它元素,如果是要在hover里设置overflow:visible;的话,之前也设过了
.diyi{overflow:hidden;}.diyi:hover{display:inline-block;border-radius:20px;background...
.diyi{ overflow:hidden; } .diyi:hover{ display:inline-block; border-radius:20px; background-color:pink; width:145px; height:25px; } .dier:hover{ display:inline-block; border-radius:20px; background-color:pink; width:145px; height:25px; } .disan:hover{ display:inline-block; border-radius:20px; background-color:pink; width:145px; height:25px; } .disi:hover{ display:inline-block; border-radius:20px; background-color:pink; width:145px; height:25px; } .diwu:hover{ display:inline-block; border-radius:20px; background-color:pink; width:145px; height:25px; }怎么弄都不对啊
展开
展开全部
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
div { overflow: hidden; width: 145px; height: 25px; }
div:hover { display: inline-block; border-radius: 20px; background-color: pink; width: 145px; height: 25px; }
</style>
</head>
<body>
<div class="d1">1</div>
<div class="d2">2</div>
<div class="d3">3</div>
<div class="d4">4</div>
<div class="d5">5</div>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
div { overflow: hidden; width: 145px; height: 25px; }
div:hover { display: inline-block; border-radius: 20px; background-color: pink; width: 145px; height: 25px; }
</style>
</head>
<body>
<div class="d1">1</div>
<div class="d2">2</div>
<div class="d3">3</div>
<div class="d4">4</div>
<div class="d5">5</div>
</body>
</html>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询