<!--
a:hover {
text-decoration: underline;
font-family: '新細明體';
font-size: 9pt;
color: #FFFFFF;
}
.link {
font-family: '新細明體';
font-size: 9pt;
color: #DBD9FF;
text-decoration: none;
}
-->
</style>
<a href="#" target="main" class="link">STEP</a>
怎么用javascript 动态的改变样式中各个项目的值呢?
不如说要改变a:hover下面的颜色值,该怎么做呢??
在线等待,谢谢。。。
4 个解决方案
#1
<style type='text/css'>
<!--
a:hover {
text-decoration: underline;
font-family: '新細明體';
font-size: 9pt;
color: #FFFFFF;
}
.link {
font-family: '新細明體';
font-size: 9pt;
color: #DBD9FF;
text-decoration: none;
}
-->
</style>
<script>
document.styleSheets[0].rules.item(0).style.color="red";
</script>
<a href="#" target="main" class="link">STEP</a>
<!--
a:hover {
text-decoration: underline;
font-family: '新細明體';
font-size: 9pt;
color: #FFFFFF;
}
.link {
font-family: '新細明體';
font-size: 9pt;
color: #DBD9FF;
text-decoration: none;
}
-->
</style>
<script>
document.styleSheets[0].rules.item(0).style.color="red";
</script>
<a href="#" target="main" class="link">STEP</a>
#2
OR
<script>
document.styleSheets[0].rules("a:hover").style.color="green";
</script>
<script>
document.styleSheets[0].rules("a:hover").style.color="green";
</script>
#3
bencalie(Bencalie)
小弟笨拙,兄台能帮我多写几个吗?我把分都给你,
帮我写下面的样式中的body的背景颜色,背景图片
<style type='text/css'>
<!--
body {
background-color: #21449C;
background-image: url(200212151503247353.jpg);
}
a:hover {
text-decoration: underline;
font-family: '新細明體';
font-size: 9pt;
color: #FFFFFF;
}
.link {
font-family: '新細明體';
font-size: 9pt;
color: #DBD9FF;
text-decoration: none;
}
.text {
font-family: '新細明體';
font-size: 9pt;
color: #DBD9FF;
}
-->
</style>
小弟笨拙,兄台能帮我多写几个吗?我把分都给你,
帮我写下面的样式中的body的背景颜色,背景图片
<style type='text/css'>
<!--
body {
background-color: #21449C;
background-image: url(200212151503247353.jpg);
}
a:hover {
text-decoration: underline;
font-family: '新細明體';
font-size: 9pt;
color: #FFFFFF;
}
.link {
font-family: '新細明體';
font-size: 9pt;
color: #DBD9FF;
text-decoration: none;
}
.text {
font-family: '新細明體';
font-size: 9pt;
color: #DBD9FF;
}
-->
</style>
#4
好了,小弟明白,谢谢了。。
#1
<style type='text/css'>
<!--
a:hover {
text-decoration: underline;
font-family: '新細明體';
font-size: 9pt;
color: #FFFFFF;
}
.link {
font-family: '新細明體';
font-size: 9pt;
color: #DBD9FF;
text-decoration: none;
}
-->
</style>
<script>
document.styleSheets[0].rules.item(0).style.color="red";
</script>
<a href="#" target="main" class="link">STEP</a>
<!--
a:hover {
text-decoration: underline;
font-family: '新細明體';
font-size: 9pt;
color: #FFFFFF;
}
.link {
font-family: '新細明體';
font-size: 9pt;
color: #DBD9FF;
text-decoration: none;
}
-->
</style>
<script>
document.styleSheets[0].rules.item(0).style.color="red";
</script>
<a href="#" target="main" class="link">STEP</a>
#2
OR
<script>
document.styleSheets[0].rules("a:hover").style.color="green";
</script>
<script>
document.styleSheets[0].rules("a:hover").style.color="green";
</script>
#3
bencalie(Bencalie)
小弟笨拙,兄台能帮我多写几个吗?我把分都给你,
帮我写下面的样式中的body的背景颜色,背景图片
<style type='text/css'>
<!--
body {
background-color: #21449C;
background-image: url(200212151503247353.jpg);
}
a:hover {
text-decoration: underline;
font-family: '新細明體';
font-size: 9pt;
color: #FFFFFF;
}
.link {
font-family: '新細明體';
font-size: 9pt;
color: #DBD9FF;
text-decoration: none;
}
.text {
font-family: '新細明體';
font-size: 9pt;
color: #DBD9FF;
}
-->
</style>
小弟笨拙,兄台能帮我多写几个吗?我把分都给你,
帮我写下面的样式中的body的背景颜色,背景图片
<style type='text/css'>
<!--
body {
background-color: #21449C;
background-image: url(200212151503247353.jpg);
}
a:hover {
text-decoration: underline;
font-family: '新細明體';
font-size: 9pt;
color: #FFFFFF;
}
.link {
font-family: '新細明體';
font-size: 9pt;
color: #DBD9FF;
text-decoration: none;
}
.text {
font-family: '新細明體';
font-size: 9pt;
color: #DBD9FF;
}
-->
</style>
#4
好了,小弟明白,谢谢了。。