JavaScript CSS Style属性对照表
JavaScript代码
<mce:script type="text/javascript"><!--
function imageOver(e) {
e.style.border="1px solid red";
}
function imageOut(e) {
e.style.borderWidth=0;
}
// --></mce: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
文字
相关文档:
在asp.net中,有的时候要动态变换CSS,比如有的时候做个性化页面,可以这样做
<head>
<link id="MyStyleSheet" rel="stylesheet" type="text/css" runat="server" />
</head>
之后,在要更换CSS的页面中,使用如下代码
Sub Page_Load(Sender As Object, E As EventArgs)
If Not (IsPostBack) ......
内容从网上收集,收集目的仅供研究、学习。涉及版权或不希望收录您的文章请您及时与我联系。
方法一:
个人认为最好的方法.采用的是正则表达式,这是最核心的原理.
其次.这个方法使用了JavaScript 的prototype 属性
其实你不使用这个属性一样可以用函数实现.但这样做后用起来比较方便.
下面就来看看这个属性是怎么来用的 ......
下面都是我收集的一些比较常用的正则表达式,因为平常可能在表单验证的时候,用到的比较多。特发出来,让各位朋友共同使用。呵呵。
匹配中文字符的正则表达式: [u4e00-u9fa5]
评注:匹配中文还真是个头疼的事,有了这个表达式就好办了
匹配双字节字符(包括汉字在内):[^x00-xff]
评注:可以用来计算字符串的长度(一个 ......
一 CSS文字属性:
color : #999999; /*文字颜色*/
font-family : 宋体,sans-serif; /*文字字体*/
font-size : 9pt; /*文字大小*/
font-style:itelic; /*文字斜体*/
font-variant:small-caps; /*小字体*/
letter-spacing : 1pt; /*字间距离*/
line-height : 200%; /*设置行高*/
......
1.大家在实际工作中,会写各式各样的赋值语句。
比如最常用的obj.style.display = "none";
如果这样的赋值语句一多,obj.style一排下来都要看晕了
下面我的base.js中的extend函数可以允许用json格式赋值属性甚至是函数句柄
/**
* 扩展函数
* @param target 需要扩展的对象
* @para ......