Html 如何在鼠标悬停在li上时更改所有字体颜色
当我将鼠标悬停在一个列表元素(一个矩形)上时,里面的所有文本都变成白色,背景变成橙色 我的问题是,当您将鼠标悬停在li元素上时,“discProd”类中的文本不会变为白色。只有第一个文本变为白色 HTMLHtml 如何在鼠标悬停在li上时更改所有字体颜色,html,css,background,hover,html-lists,Html,Css,Background,Hover,Html Lists,当我将鼠标悬停在一个列表元素(一个矩形)上时,里面的所有文本都变成白色,背景变成橙色 我的问题是,当您将鼠标悬停在li元素上时,“discProd”类中的文本不会变为白色。只有第一个文本变为白色 HTML <ol id="selectable"> <li class="ui-state-list"> <b>TD101</b> SmarTach + D: Tachometer</br> <h5
<ol id="selectable">
<li class="ui-state-list">
<b>TD101</b> SmarTach + D: Tachometer</br>
<h5 class="discProd">Discontinued - See TA300 for replacement model</h5>
</li>
</ol>
您需要将悬停效果分别应用于
discProd
类,如下所示:
#selectable li:hover {background: orange; color: white; }
#selectable li:hover .discProd {background: orange; color: white; }
您需要将悬停效果分别应用于
discProd
类,如下所示:
#selectable li:hover {background: orange; color: white; }
#selectable li:hover .discProd {background: orange; color: white; }
您需要将悬停效果分别应用于
discProd
类,如下所示:
#selectable li:hover {background: orange; color: white; }
#selectable li:hover .discProd {background: orange; color: white; }
您需要将悬停效果分别应用于
discProd
类,如下所示:
#selectable li:hover {background: orange; color: white; }
#selectable li:hover .discProd {background: orange; color: white; }
将此选项用于悬停:
#selectable li:hover, #selectable li:hover > .discProd {
background: orange;
color: white;
}
无需重新定义类,只需将其应用于.discProd
演示:将此用于悬停:
#selectable li:hover, #selectable li:hover > .discProd {
background: orange;
color: white;
}
无需重新定义类,只需将其应用于.discProd
演示:将此用于悬停:
#selectable li:hover, #selectable li:hover > .discProd {
background: orange;
color: white;
}
无需重新定义类,只需将其应用于.discProd
演示:将此用于悬停:
#selectable li:hover, #selectable li:hover > .discProd {
background: orange;
color: white;
}
无需重新定义类,只需将其应用于.discProd
演示: