CSS属性与JavaScript 编码方法对照表

时间:2008-12-01 13:01:00 

CSS与JS紧密配合,为我们的页面增添了很多别致的效果。为了达到某种特殊的效果我们需要用Javascript动态的去更改某一个标签的CSS属性。

比如:鼠标经过一个图片时我们让图片加一个边框,代码可能是这样: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



 

标签:javascript,css,属性,编码,对照表
0
投稿

猜你喜欢

  • 在查询分析器理启动或停止SQL Agent服务

    2009-01-08 16:20:00
  • 超链“确认”对话框confirm

    2008-05-16 11:42:00
  • oracle学习笔记(二)

    2012-01-05 18:59:20
  • 用server.transfer隐藏网页真实地址

    2007-12-04 13:02:00
  • HTML在线编辑器的原理分析(整理)

    2007-12-22 10:25:00
  • asp 去掉html中的table正则代码函数

    2011-04-06 10:48:00
  • ADO组件之分页程序详解

    2008-10-09 12:28:00
  • Dreamweaver制作网页幻灯片效果

    2010-07-06 13:48:00
  • 改善登陆界面的用户体验: 自动聚焦表单

    2009-12-09 16:13:00
  • 使用FORFILES命令来删除SQLServer备份的批处理

    2012-05-08 06:47:06
  • 交互设计实用指南系列(8)—深广度平衡

    2010-02-01 12:59:00
  • 用一个案例讲解SQL Server数据库恢复

    2008-11-28 14:17:00
  • hover悬停放大的翻页效果

    2008-05-19 12:20:00
  • XML卷之实战锦囊(1):动态排序

    2008-09-05 17:20:00
  • 一个ACCESS数据库数据传递的方法

    2008-03-05 11:58:00
  • asp之让Session永不过期

    2011-04-15 10:42:00
  • 如何把图片上传到数据库中并显示出来?

    2009-11-06 13:50:00
  • Flash在某些多标签浏览器中的“伪沙箱”问题

    2011-01-06 12:37:00
  • 说说回车键触发表单提交的问题

    2009-02-03 13:25:00
  • Mysql数据库备份和还原常用的命令

    2011-12-01 10:41:54
  • asp之家 网络编程 m.aspxhome.com