手机
当前位置:查字典教程网 >网页设计 > Div+Css教程 >css中style和class的加载顺序示例介绍
css中style和class的加载顺序示例介绍
摘要: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的属性!

【css中style和class的加载顺序示例介绍】相关文章:

CSS中Font的一些基本知识点归纳总结

IE6定义1px左右高度的容器示例代码

css3的图形3d翻转效果应用示例

CSS导航布局中当前页面的具体实现demo示例

控制css字间距和对齐方式所用属性介绍

css中ul li的背景小图标属性设置的两种情况

background和background-Color的区别介绍

css中em px 区别你真的了解吗

CSS3实现的闪烁跳跃进度条示例

邮箱css加载失败怎么办

精品推荐
分类导航