css 中text

html-css013

css 中text,第1张

首行缩进(text-indent):{ text-indent: 24px}

文本对齐属性(text-align):

{ text-align: center}

{ text-align: left}

{ text-align: right}

文本修饰(text-decoration):

{ text-decoration: overline}

{ text-decoration: underline}

{ text-decoration: line-through}

{ text-decoration:none}

用css选择页面中所有的文本框,可以使用多种方式,这些方式也是针对不同的浏览器做出的兼容性支持。

input[type="text"] 这种写法不支持IE,但支持Firefox

下面这段代码就可以对所有的浏览器做出支持。

<style>

input{

   color: #FFF

   }

 

<!--针对IE的-->

input{

   color:expression(this.type=="text"? red:"style")

   }

 

<!--针对IE以外的浏览器-->

input[type="text"] {

    color: red

    }

</style>

这样写

body

{

color:red

font-size:12px

font-family:宋体

……

}