CSS和JavaScript标签style属性对照表
CSS和JavaScript标签style属性对照表
一般情况是把"-"去掉,后面字母用大写。
CSS语法 (不区分大小写) JavaScript语法 (区分大小写)
border border
border-bottom borderBottom
border-bottom-color borderBottomColor
border-bottom-style borderBottomStyle
border-bottom-width borderBottomWidth
border-color borderColor
border-left borderLeft
border-left-color borderLeftColor
border-left-style borderLeftStyle
border-left-width borderLeftWidth
border-right borderRight
border-right-color borderRightColor
border-right-style borderRightStyle
border-right-width borderRightWidth
border-style borderStyle
border-top borderTop
border-top-color borderTopColor
border-top-style borderTopStyle
border-top-width borderTopWidth
border-width borderWidth
clear clear
float float //styleFloat(IE)/cssFloat(FireFox)
margin margin
margin-bottom marginBottom
margin-left marginLeft
margin-right marginRight
margin-top marginTop
padding padding
padding-bottom paddingBottom
padding-left paddingLeft
padding-right paddingRight
padding-top paddingTop
颜色和背景标签和属性对照
background background
background-attachment backgroundAttachment
background-color backgroundColor
background-image backgroundImage
background-position backgroundPosition
background-repeat backgroundRepeat
color color
样式标签和属性对照
display display
list-style-type listStyleType
list-style-image listStyleImage
list-style-position listStylePosition
list-style listStyle
white-space whiteSpace
文字样式标签和属性对照
font font
font-family fontFamily
font-size fontSize
font-style fontStyle
font-variant fontVariant
font-weight fontWeight
文本标签和属性对照
letter-spacing letterSpacing
line-break lineBreak
line-height lineHeight
text-align textAlign
text-decoration textDecoration
text-indent textIndent
text-justify textJustify
text-transform textTransform
vertical-align verticalAlign
补充:
style 获取的是内联样式,即style属性中的值,可以用其改变元素显示样式
currentStyle 只有 IE 和 Opera 支持,获取 HTMLElement 的计算后的样式,其他浏览器中不支持
getComputedStyle 在标准浏览器中使用,IE9也支持getComputedStyle,但是支持不完全,比如border
var element = document.getElementById("id");
var currentStyle = element.currentStyle? element.currentStyle : window.getComputedStyle(element, null);
var float = currentStyle.getPropertyValue("float")//float 旧版浏览器保持兼容的简单方式
CSS和JavaScript标签style属性对照表的更多相关文章
- CSS和JS标签style属性对照表
盒子标签和属性对照 CSS语法(不区分大小写) JavaScript语法(区分大小写) border border border-bottom borderBottom border-bottom-c ...
- JavaScript CSS Style属性对照表
JavaScript CSS Style属性对照表 盒子标签和属性对照 CSS语法 (不区分大小写) JavaScript语法 (区分大小写) border border border-bottom ...
- css字体样式(Font Style),属性
css字体样式(Font Style),属性 css字体样式(Font Style)是网页中不可或缺的样式属性之一,有了字体样式,我们的网页才能变得更加美观,因此字体样式属性也就成为了每一位设计者 ...
- JavaScript之Style属性学习
当CSS使用伪类开始侵入DOM和JavaSCript所控制着的行为层时,DOM和JavaScript也使用他们的一系列样式去控制表现层,这篇随笔主要说的就是利用JavaScript去控制元素的表现形式 ...
- HTML+css基础 img 标签的属性
img: src=”” src是标签的属性 等号右边是属性值.就是图片的路径. 路径 1. 绝对路径:按照一个路径能找到,具体到某一个盘符下,某一个文件夹内. 2. 相对路径:以当前页面为参考物,去查 ...
- javascript原生style属性分析
1 <!DOCTYPE html> 2 <html> 3 <head lang="en"> 4 <meta charset="U ...
- JS中style属性
解决办法:1.先定义一个CSS规则,然后this.className=''2.document.getElementByIdx_x("a").style.cssText=" ...
- 《浏览器工作原理与实践》<05>渲染流程(上):HTML、CSS和JavaScript,是如何变成页面的?
在上一篇文章中我们介绍了导航相关的流程,那导航被提交后又会怎么样呢?就进入了渲染阶段.这个阶段很重要,了解其相关流程能让你“看透”页面是如何工作的,有了这些知识,你可以解决一系列相关的问题,比如能熟练 ...
- html 样式之style属性的使用
转自:https://www.ggbiji.com/html-style.html html中的style属性是用来改变html元素的样式的,样式是 在html 4 引入的,它是改变 html元素样式 ...
随机推荐
- 关于Python中的yield
关于Python中的yield 在介绍yield前有必要先说明下Python中的迭代器(iterator)和生成器(constructor). 一.迭代器(iterator) 在Python中,f ...
- 《我是IT小小鸟》读书笔记
转眼间,大学的第二学期悄悄来临了,老师给我们布置了一道原本我以为很无趣的题目----写<我是IT的读书笔记>,但是我读了<我是IT小小鸟>这本书后,令我受益匪浅:五个人,每个人 ...
- 【BZOJ】【1177】【APIO2009】Oil
DP 找出三个正方形,可以转化为将整个油田切成三个矩形块,每块中各找一个正方形区域,切的形式只有6种,分类更新ans即可 题解:http://trinklee.blog.163.com/blog/st ...
- phonegap上传以及下载图片
在phonegap中,有时我们需要从服务器下载图片以及上传图片,这个时候可以用到官方提供的一个插件:FileTransfer 首先通过命令添加插件: cordova plugin add org.ap ...
- javascript版Ajax请求
什么是Ajax请求,Ajax也就是“Asynchronous JavaScript and XML”(异步JavaScript和XML),无刷新数据读取.能减少流量的消耗,也提高了浏览的流畅性,给用户 ...
- 威胁远胜“心脏出血”?国外新爆Bash高危安全漏洞
这几天Linux用户们可能不能愉快地玩耍了,红帽(Redhat)安全团队昨天爆出一个危险的Bash Shell漏洞.其带来的威胁可能比早前披露的“心脏出血”漏洞更大更强! [OpenSSL心脏出血漏洞 ...
- Codeforces Round #243 (Div. 1) A题
http://codeforces.com/contest/425/problem/A 题目链接: 然后拿出这道题目是很多人不会分析题目,被题目吓坏了,其中包括我自己,想出复杂度,一下就出了啊!真是弱 ...
- jquery的ajax同步和异步的理解及示例
之前一直在写JQUERY代码的时候遇到AJAX加载数据都需要考虑代码运行顺序问题.最近的项目用了到AJAX同步.这个同步的意思是当JS代码加载到当前AJAX的时候会把页面里所有的代码停止加载,页面出去 ...
- xxx.properties获取方法
1.手动获取加载 Locale locale = Locale.getDefault(); ResourceBundle localResource = ResourceBundle.getBundl ...
- Android Environment FAQ (Frequently Asked Question)
1.how to find out the Eclipse Version From Eclipse Menu Help ----> About Eclipse It displayed as ...