CSS和JS标签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
相关文档:
一.使用css缩写
使用缩写可以帮助减少你CSS文件的大小,更加容易阅读。css缩写的主要规则请参看《常用css缩写语法总结》,这里
就不展开描述。
二.明确定义单位,除非值为0
忘记定义尺寸的单位是CSS新手普遍的错误。在HTML中你可以只写width="100",但是在CSS中,你必须给一个准确的单
位,比如:width: 100px width: ......
JavaScript动态加载CSS的三种方法 收藏
如果你有很多关联的CSS文件要一起加载,或者想动态的加载不同的CSS文件,那么下面的方法你一定对你有帮助。
第一种:一般用在外部CSS文件中加载必须的文件
程序代码
@import url(style.css);
/*只能用在CSS文件中或者style标签中*/
第二种:简单的在页面中加载一 ......
最简单的办法:假设你有两个颜色的CSS文件red.css,green.css,默认为红色的样式
<link rel="stylesheet" style="text/css" link="red.css" id="colorcss">
<input type="button" name="redcss" value='红色' onclick="javascript:document.getElementById('colorcss').href='red.css'">
<input type="butt ......
模块:module.css
基本共用:base.css
布局、版面:layout.css
主题:themes.css
专栏:columns.css
文字:font.css
表单:forms.css
补丁:mend.css
打印:print.css
头:header
内容:content/container
尾:footer
导航:nav
侧栏:sidebar
栏目:column
页面外围控制整体布局宽度: ......
一 CSS文字属性:
color : #999999; /*文字颜色*/
font-family : 宋体,sans-serif; /*文字字体*/
font-size : 9pt; /*文字大小*/
font-style:itelic; /*文字斜体*/
font-variant:small-caps; /*小字体*/
letter-spacing : 1pt; /*字间距离*/
line-height : 200%; /*设置行高*/
......