您的位置:首页 > Web前端 > CSS

如何应用JS来改变CSS样式

2012-12-15 16:27 417 查看
若是一个页面要同时显示简体字,繁体字,那么gbk编码就足够了。但若是还要显示日文,韩文等,那就非utf-8不成了。在unicode里,u0800-u9FFF为中、韩、日字符。此中,中文的局限:u4e00-u9fa5,日文在u0800-u4e00,韩文为u9fa5以上。
??? 但其实,用utf-8的话还是会有一个题目标。有一些汉字,在日文里也有应用,但写法和我们凡是的写法有略有不合,也还可以辩认。如下图,第一行是汉字凡是的写法,第二行是日文里的,写法上也略有变革。日文里该当就是直接用了中文,但因为汗青上汉字就有很多异形字,两国各自标准化时采取的写法不一样。如许该当编成两个字符还是一个字符,确切也不好断定。今朝,在unicode里,它们是编成一个字符。如今看起来不合是因为它们的字体不一样(第一行是宋体,第二行是MS Mincho),就是说,在一篇中文和日文混排的文章里,要想让分清楚这两种,用一种字体是不成能的。也就是说,要分隔中文和日文,仅看unicode编码是不敷的,还要搜检字体。

如何应用JS来改变CSS样式

办法:?

document.getElementById("xx").style.xxx中的所有属性是什么

盒子标签和属性对比色彩和靠山标签和属性对比样式标签和属性对比文字样式标签和属性对比文本标签和属性对比
CSS语法(不区分大小写)JavaScript语法(区分大小写)
borderborder
border-bottomborderBottom
border-bottom-colorborderBottomColor
border-bottom-styleborderBottomStyle
border-bottom-widthborderBottomWidth
border-colorborderColor
border-leftborderLeft
border-left-colorborderLeftColor
border-left-styleborderLeftStyle
border-left-widthborderLeftWidth
border-rightborderRight
border-right-colorborderRightColor
border-right-styleborderRightStyle
border-right-widthborderRightWidth
border-styleborderStyle
border-topborderTop
border-top-colorborderTopColor
border-top-styleborderTopStyle
border-top-widthborderTopWidth
border-widthborderWidth
clearclear
floatfloatStyle
marginmargin
margin-bottommarginBottom
margin-leftmarginLeft
margin-rightmarginRight
margin-topmarginTop
paddingpadding
padding-bottompaddingBottom
padding-leftpaddingLeft
padding-rightpaddingRight
padding-toppaddingTop
CSS 语法(不区分大小写)JavaScript 语法(区分大小写)
backgroundbackground
background-attachmentbackgroundAttachment
background-colorbackgroundColor
background-imagebackgroundImage
background-positionbackgroundPosition
background-repeatbackgroundRepeat
colorcolor
?
CSS语法(不区分大小写)JavaScript 语法(区分大小写)
displaydisplay
list-style-typelistStyleType
list-style-imagelistStyleImage
list-style-positionlistStylePosition
list-stylelistStyle
white-spacewhiteSpace
?
CSS 语法(不区分大小写)JavaScript 语法(区分大小写)
fontfont
font-familyfontFamily
font-sizefontSize
font-stylefontStyle
font-variantfontVariant
font-weightfontWeight
?
CSS 语法(不区分大小写)JavaScript 语法(区分大小写)
letter-spacingletterSpacing
line-breaklineBreak
line-heightlineHeight
text-aligntextAlign
text-decorationtextDecoration
text-indenttextIndent
text-justifytextJustify
text-transformtextTransform
vertical-alignverticalAlign

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: