最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

淺析JavaScript中的CSS屬性及命名規(guī)范

 更新時(shí)間:2013年11月28日 09:58:32   作者:  
這篇文章主要介紹了JavaScript中的CSS屬性及命名規(guī)范。需要的朋友可以過來(lái)參考一下,希望對(duì)大家有所幫助

許多CSS樣式屬性的名字中都有連字符,在JavaScript中,連字符被解釋為減號(hào)。

因此,CSS2Properties對(duì)象的屬性名和真正的CSS屬性名有點(diǎn)不同。

如果一個(gè)CSS屬性名含有一個(gè)或多個(gè)連字符,在JS中則需要?jiǎng)h除了連字符,并且原來(lái)緊接在連字符后的字母改為大寫。

要注意的是float是JS的關(guān)鍵字,所以在JS中float被寫作cssFloat與或floatStyle。

下面是CSS自身屬性與JavaScript中CSS編碼對(duì)照表:


盒子標(biāo)簽和屬性對(duì)照:
Code
CSS語(yǔ)法 (不區(qū)分大小寫)   JavaScript語(yǔ)法 (區(qū)分大小寫)
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(ie) cssFloat(FF) 
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

 

顏色和背景標(biāo)簽和屬性對(duì)照:
Code
CSS語(yǔ)法 (不區(qū)分大小寫)   JavaScript語(yǔ)法 (區(qū)分大小寫)
background   background
background-attachment   backgroundAttachment
background-color   backgroundColor
background-image   backgroundImage
background-position   backgroundPosition
background-repeat   backgroundRepeat
color   color


樣式標(biāo)簽和屬性對(duì)照:

Code
CSS語(yǔ)法 (不區(qū)分大小寫)   JavaScript語(yǔ)法 (區(qū)分大小寫)
display   display
list-style-type   listStyleType
list-style-image   listStyleImage
list-style-position   listStylePosition
list-style   listStyle
white-space   whiteSpace


文字樣式標(biāo)簽和屬性對(duì)照:

Code
CSS語(yǔ)法 (不區(qū)分大小寫)   JavaScript語(yǔ)法 (區(qū)分大小寫)
font   font
font-family   fontFamily
font-size   fontSize
font-style   fontStyle
font-variant   fontVariant
font-weight   fontWeight

 

文本標(biāo)簽和屬性對(duì)照:
Code
CSS語(yǔ)法 (不區(qū)分大小寫)   JavaScript語(yǔ)法 (區(qū)分大小寫)
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

相關(guān)文章

最新評(píng)論

丘北县| 青铜峡市| 府谷县| 伊川县| 广元市| 伊春市| 柯坪县| 东海县| 河西区| 雅江县| 承德市| 荣昌县| 肇源县| 综艺| 申扎县| 东阳市| 晋州市| 黑河市| 蕲春县| 凯里市| 巩留县| 同仁县| 班玛县| 古蔺县| 大悟县| 临清市| 安陆市| 安化县| 万安县| 高要市| 霍林郭勒市| 辛集市| 仪陇县| 桐乡市| 武清区| 宁乡县| 莱阳市| 常州市| 南乐县| 马边| 黄骅市|