所有主要浏览器都支持 textTransform 属性。注意:IE7 及更早的版本不支持 "inherit" 值。IE8 只有规定了 !DOCTYPE 才支持 "inherit"。IE9 支持 "inherit"。实例实例 把每个单词的首字母转换为大写: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鸟教程(runoob.com)</title> <...
CSS text-transform 属性 实例 转换不同元素中的文本: h1 {text-transform:uppercase;} h2 {text-transform:capitalize;} p {text-transform:lowercase;} 尝试一下 » 属性定义及使用说明 text-transform 属性控制文本的大小写。 默认值: n
textTransform 属性会改变元素中的字母大小写,而不论源文档中文本的大小写。 语法: Object.style.whiteSpace=normal|nowrap|pre 可能的值 值描述 none默认。定义带有小写字母和大写字母的标准的文本。 capitalize文本中的每个单词以大写字母开头。 uppercase定义仅有大写字母。
Transform the first letter of each word in an element to uppercase: document.getElementById("demo").style.textTransform="capitalize"; Try it Yourself » Description The textTransform property sets or returns the capitalization of a text. ...
HTML DOM Style 对象 定义和用法 textTransform 属性会改变元素中的字母大小写,而不论源文档中文本的大小写。 语法: </>code Object.style.textTransform="none|capitalize|uppercase|lowercase|inherit" 可能的值 实例 本例把每个单词的第一个字母转换为大写: ...
g.ScaleTransform(1.5f,0.5f);运行之后,整个世界坐标系会将横轴扩大1.5倍,纵横缩小0.5倍;这样的后果是,用于验证的红色矩形原坐标与长宽为new Rectangle(20, 20, 100, 100);在ScaleTransform运行后,实绘制出来如上图所示,即坐标与长宽会分别在横轴扩大1.5倍,在纵横缩小0.5倍,为new Rectangle(20*1.5=30,20*0.5...
The text-transform CSS property specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized. It also can help improve legibility for ruby.
Learn to style HTML using CSS Related CSS properties: text-justify text-orientation text-overflow text-rendering text-transform hanging-punctuation CSS Text Decoration CSS module CSS Text module Help improve MDN Was this page helpful to you? YesNoLearn how to contribute. This page was last mod...
CSS text-transform 属性用于指定如何将单词或单独的字母转换为大写字母。 text-transform属性对中文无效。它可以将英文单词或字母转换为全大写或全小写,或者每个单词的第一个字母大写的格式。 官方语法 text-transform: none | capitalize | uppercase | lowercase | full-width 参数: none:不对文字进行转换。
.transform1 {text-transform:uppercase} .transform2 {text-transform:lowercase} .transform3 {text-transform:none } </style> </head> <body> <div style="font-size:14" onmouseover="this.className='transform1'" onclick= "this.className='transform2'" ondblclick="this.className='transform3'"> :...