本文介绍了在鼠标悬停时更改文本的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
不起作用:-onmouseover ="this.bgColor =" gold;"请提出
STATE |
---|
ANDHRA PRADESH |
ARUNACHAL PRADESH |
ASSAM |
BIHAR |
Not working :- onmouseover="this.bgColor=''gold'';" please suggest
STATE |
---|
ANDHRA PRADESH |
ARUNACHAL PRADESH |
ASSAM |
BIHAR |
推荐答案
onmouseover="this.style.color=''gold''"
.mouseover:hover
{
background-color:Yellow;
color:Blue;
text-decoration:none;
}
.mouseover
{
background-color:Blue;
color:Yellow;
text-decoration:none;
}
a:hover
{
background-color:yellow;
}
<a href="/test.aspx">test</a>
更新
Update
<style type="text/css">
.clstd
{
background-color:red;
}
/*include this in your style must work*/
.clstd:hover
{
background-color:yellow;
}
</style>
您正在使用类(css),并且再次使用内联属性.最好将CSS中的所有内容都包含在内,因为所有td都具有相同的宽度,高度等,而不是为它们中的每一个书写.
You are using a class(css) and again using inline properties. It is good to include everything in your css as all the td''s are having same width, height etc. instead of writing for each of them.
这篇关于在鼠标悬停时更改文本的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!