Css 如何在将鼠标悬停在另一个用途上时更改一个元素,然后再停止工作
HTMLCss 如何在将鼠标悬停在另一个用途上时更改一个元素,然后再停止工作,css,hover,Css,Hover,HTML <div class="related_files_data"> <h2> <a href="./?a=content.id&id=96">example 1</a> </h2> <h2> <a href="./?a=content.id&id=95">example 2</a> </h2>
<div class="related_files_data">
<h2>
<a href="./?a=content.id&id=96">example 1</a>
</h2>
<h2>
<a href="./?a=content.id&id=95">example 2</a>
</h2>
我想更改悬停第一个元素上的图标
对于写不好的代码使用
selector:state:psuedo
,您可以针对选择器的状态:
.related_files_data h2:hover:before{
color: #f8482e;
content: "";
font-family: fontawesome;
font-size: 14px;
}
。相关的\u文件\u数据h2::之前{
颜色:#6dd7f8;
内容:“";
字体系列:Fontsome;
字体大小:14px;
}
.related_files_data h2:hover::before{
颜色:#f8482e;
内容:“";
字体系列:Fontsome;
字体大小:14px;
}
您想更改哪个图标,在哪个位置悬停?如果我正确理解@DmitryB,代码写得不好。请将其作为答案发布。
.related_files_data h2:hover:before{
color: #f8482e;
content: "";
font-family: fontawesome;
font-size: 14px;
}