【发布时间】:2019-12-09 12:35:43
【问题描述】:
我正在寻找一种仅使用 html 来编辑 div 悬停的方法。我只需要它是 html,因为代码允许无限数量的相同 div 的不同版本,它们都是不同的颜色。我知道对于常规 div,您可以包含 style="color: red" 但这只能让我编辑原始 div。我需要一个代码,只允许我在悬停时这样做。
TLDR:我希望能够在 html 中编辑 circle:hover。任何帮助将不胜感激。
CSS
.circle {
border-radius: 32px;
width: 25px;
height: 25px;
float: left;
font-size: 20px;
overflow: hidden;
margin: 30px 15px 30px 15px;
transition: height 0.5s ease;
border: 2px solid transparent;
}
.circle:hover {
border-radius: 32px;
border: 2px solid #fff;
height: 200px;
transition: height 0.5s ease;
}
#text {
text-align: center;
transform: rotate(-90deg);
margin-top: 115px;
font-family: 'Roboto', sans-serif;
text-transform: uppercase;
}
HTML
<div class="circle" style="background: rgba(197,214,210,1); box-shadow:
0px 0px 0px 20px rgba(197,214,210,0.4);"><div id="text">#C5D6D2</div>
</div>
【问题讨论】:
标签: html