css中style和class的加载顺序示例介绍_ Div+Css教程-查字典教程网
css中style和class的加载顺序示例介绍
css中style和class的加载顺序示例介绍
发布时间:2016-12-27 来源:查字典编辑
摘要:test.aa{cursor:wait;color:#f00;}functionclickD(obj){//obj.style.color=...

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>test</title>

<meta name="author" content="Administrator" />

<>

<style type="text/css" media="screen">

.aa{

cursor: wait;

color: #f00;

}

</style>

<script type="text/javascript">

function clickD(obj){

//obj.style.color = "#f00";

//obj.style.cursor = "wait";

obj.className = "aa";

}

</script>

</head>

<body>

<div>点击了试一下</div>

</body>

</html>

这样的写法,不会覆盖style的cursor属性,以style中的属性为最后结果!

用注释中的写法,会覆盖掉style的属性!

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新 Div+Css教程学习
    热门 Div+Css教程学习
    网页设计子分类