当前位置: 首页 > 图文教程 > 网页制作 > CSS样式表 > JavaScript CSS Style属性对照表

CSS样式表
未知长宽元素在已知300px*300px的容器中垂直居中(IE6/7/8/FF)
CSS dashed和dotted的区别
css 超过宽度的文字显示点点
不同浏览器对CSS3和HTML5的支持状况
使用DIV+CSS布局网站的优点和缺陷分析
CSS样式表中的position属性详细说明
css 圆角边框
CSS 网页布局问题 li上多出的margin问题
为什么有些css样式不起作用
tab选项卡布局之利用a的一个选项形式
UL、LI 无序列表实现纯CSS网站导航菜单
在IE下,当margin:0 auto;无法使得块级元素水平居中时
IE bug input 外层浮动的边距问题
重置浏览器默认样式
两种跨浏览器的自适应高的css代码
纯CSS无hacks的跨游览器自适应高度多列布局 推荐
IE中伪类hover的使用及BUG
img与容器下边界的空隙(缝隙) 的解决方法
CSS入门篇之传智播客学习
CSS3 倾斜的网页图片库实例教程

CSS样式表 中的 JavaScript CSS Style属性对照表


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-20   浏览: 335 ::
收藏到网摘: n/a

比如:鼠标经过一个图片时我们让图片加一个边框,代码可能是这样:

JavaScript代码

复制代码
代码如下:

<script type="text/javascript">   
    function imageOver(e) {   
        e.style.border="1px solid red";   
    }   
    function imageOut(e) {   
        e.style.borderWidth=0;   
    }   
</script>   
<img src="phplamp.gif" onmouseover="imageOver(this)" onmouseout="imageOut(this)" />  

JavaScript中style后面的属性应该是什么?
JavaScript CSS 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 floatStyle
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
 
颜色和背景标签和属性对照
CSS语法 (不区分大小写) JavaScript语法 (区分大小写)
background background
background-attachment backgroundAttachment
background-color backgroundColor
background-image backgroundImage
background-position backgroundPosition
background-repeat backgroundRepeat
color color
 
样式标签和属性对照
CSS语法 (不区分大小写) JavaScript语法 (区分大小写)
display display
list-style-type listStyleType
list-style-image listStyleImage
list-style-position listStylePosition
list-style listStyle
white-space whiteSpace
 
文字样式标签和属性对照
CSS语法 (不区分大小写) JavaScript语法 (区分大小写)
font font
font-family fontFamily
font-size fontSize
font-style fontStyle
font-variant fontVariant
font-weight fontWeight
 
文本标签和属性对照
CSS语法 (不区分大小写) JavaScript语法 (区分大小写)
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