原生JS控制CSS样式语法对照
来源:互联网 发布:网络主播loli王春雨 编辑:程序博客网 时间:2024/06/06 03:40
CSS与JS紧密配合,为我们的页面增添了很多别致的效果。为了达到某种特殊的效果我们需要用Javascript动态的去更改某一个标签的CSS属性。
例如常用的关闭某个漂浮的广告显示:document.getElementById('ad').style.display='none';相当于:.ad{ display:none}.
下面就是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
感謝Yangz!原文來自:Yangz博客
1 0
- 原生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样式
- JS 控制CSS样式表
- 输入密码或金额的显示和隐藏(续)
- Foxit Mobile PDF SDK尝鲜-IOS篇(1)-Run the Demo
- HDU 1251 统计难题 (字典树)
- spring AOP自学
- 读《Java并发性和多线程》有感
- 原生JS控制CSS样式语法对照
- CString与int、float之间的转换
- Make Query Layer在Model Builder中的使用
- centos7 开启
- LoadRunner自动关联
- RecyclerView下拉刷新和上拉加载更多
- HUST 1017 Exact Cover [DLX]
- android中如何去掉pulltorefreshlistview点击item时的背景颜色,与item外边距设置
- EXT2的文件系统装载之内核函数ext2_fill_super分析