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

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

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

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

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

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

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

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


盒子標(biāo)簽和屬性對(duì)照:
Code
CSS語(yǔ)法 (不區(qū)分大小寫(xiě))   JavaScript語(yǔ)法 (區(qū)分大小寫(xiě))
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ū)分大小寫(xiě))   JavaScript語(yǔ)法 (區(qū)分大小寫(xiě))
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ū)分大小寫(xiě))   JavaScript語(yǔ)法 (區(qū)分大小寫(xiě))
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ū)分大小寫(xiě))   JavaScript語(yǔ)法 (區(qū)分大小寫(xiě))
font   font
font-family   fontFamily
font-size   fontSize
font-style   fontStyle
font-variant   fontVariant
font-weight   fontWeight

 

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

平罗县| 喀喇沁旗| 奇台县| 双牌县| 新闻| 肃宁县| 津南区| 兰州市| 库尔勒市| 临清市| 华坪县| 沅陵县| 阿勒泰市| 云和县| 大埔区| 政和县| 平泉县| 金塔县| 万州区| 龙口市| 博罗县| 集安市| 宾川县| 平顶山市| 武川县| 宜君县| 乌拉特前旗| 香格里拉县| 社旗县| 古浪县| 衢州市| 郧西县| 浠水县| 延川县| 澄迈县| 轮台县| 寿阳县| 马鞍山市| 雷山县| 西乌| 芦山县|