JS控制CSS样式语法对照
来源:互联网 发布:python tf idf 编辑:程序博客网 时间:2024/06/05 08:55
JS控制CSS样式语法对照
CSS与JS紧密配合,为我们的页面增添了很多别致的效果。为了达到某种特殊的效果我们需要用Javascript动态的去更改某一个标签的CSS属性。
例如常用的关闭某个漂浮的广告显示:document.getElementById('ad').style.display='none';相当于:#ad{ display:none}.
附上一例:
<script type="text/javascript"> var objList = document.getElementsByTagName("div"); for(var i = 0; i<objList.length; i++) { if(objList[i].className == "abc") { var parentNode = objList[i].parentNode; parentNode.style.lineheight = "30px"; } } </script>
下面就是JS 控制CSS样式表的语法对照:
CSS语法 (不区分大小写)JavaScript语法 (区分大小写) borderborder border-bottomborderBottom border-bottom-colorborderBottomColor border-bottom-styleborderBottomStyle border-bottom-widthborderBottomWidth border-colorborderColor border-leftborderLeft border-left-colorborderLeftColor border-left-styleborderLeftStyle border-left-widthborderLeftWidth border-rightborderRight border-right-colorborderRightColor border-right-styleborderRightStyle border-right-widthborderRightWidth border-styleborderStyle border-topborderTop border-top-colorborderTopColor border-top-styleborderTopStyle border-top-widthborderTopWidth border-widthborderWidth clearclear floatfloatStyle marginmargin margin-bottommarginBottom margin-leftmarginLeft margin-rightmarginRight margin-topmarginTop paddingpadding padding-bottompaddingBottom padding-leftpaddingLeft padding-rightpaddingRight padding-toppaddingTopbackgroundbackground background-attachmentbackgroundAttachment background-colorbackgroundColor background-imagebackgroundImage background-positionbackgroundPosition background-repeatbackgroundRepeat colorcolor displaydisplay list-style-typelistStyleType list-style-imagelistStyleImage list-style-positionlistStylePosition list-stylelistStyle white-spacewhiteSpace fontfont font-familyfontFamily font-sizefontSize font-stylefontStyle font-variantfontVariant font-weightfontWeight letter-spacingletterSpacing line-breaklineBreak line-heightlineHeight text-aligntextAlign text-decorationtextDecoration text-indenttextIndent text-justifytextJustify text-transformtextTransform vertical-alignverticalAlign- JS控制CSS样式语法对照
- JS控制CSS样式语法对照
- JS控制CSS样式语法对照
- 原生JS控制CSS样式语法对照
- js控制CSS样式属性语法对照表
- JS 控制CSS样式表的语法对照
- js控制CSS样式属性语法对照表
- css js 语法 对照
- css与js语法对照
- js控制css样式
- JS 控制 Style(样式) 对照表
- js设置css样式对照表
- js设置css样式对照表
- JS 控制 CSS 样式表
- JS控制CSS样式大全
- js实现控制css样式
- JS 控制CSS样式表
- CSS和JS结合控制样式
- 内存管理
- linux shell重定向
- Android Droid-Fu 开源项目
- C中浮点数转字符串
- 【C语言学习趣事】_29_《C程序设计语言》_Secnod_Edition_习题
- JS控制CSS样式语法对照
- GBS文件配置概述
- C语言有符号数与无符号数之间的转换
- Oracle 学习笔记14 —— 函数
- ubuntu install apache+php+mysql
- SSE4.1指令集系列之一
- android push:Android短消息推送启动应用程序(SMS PUSH)(BroadCastReceiver)
- 浙江传媒学院实践周成果——我的音乐库管理
- Android紫衫龙王之Activity