如果说只是单纯的一个HTML页面是没有任何色彩的,我们通常需要添加一些CSS,JS样式来增加页面的色彩感,下面我们来说一下有关CSS文字方面的样式。
字体body{font-family:"宋体";}
颜色body{color:#666}
大小body{font-size:12px;}
body{font-size:1em;}
缩进p {text-indent: 2em;}
p {text-indent: 50%;} //基于父元素
字体风格p.normal {font-style:normal;}//默认
p.italic {font-style:italic;}// 斜体
p.oblique {font-style:oblique;}// 倾斜
对其方式h1{text-align:center;}
值:left、right、center、justify
字间距p{word-spacing:25px;}
p{word-spacing:normal;}// 相当与0px
字母间距h1 {letter-spacing:2px;}
h1 {letter-spacing:normal;}
字符转换h1 {text-transform: none;}//默认
h1 {text-transform: capitalize;}//首字母大写
h1 {text-transform: uppercase;}// 全部大写
h1 {text-transform: lowercase;}// 全部小写
文本修饰a {text-decoration: none;}
h1 {text-decoration:overline}//上划线
h2 {text-decoration:line-through}//中划线
h3 {text-decoration:underline}// 下划线
// blink闪烁文本,不过兼容性不好,很多浏览器都不支持
粗体p.normal {font-weight:normal;}
p.thick {font-weight:bold;}//粗体
p.bolder{font-weight:bolder;}// 更粗
p.lighter{font-weight:lighter;}// 更细
p.thicker {font-weight:900;}//400 等同于 normal,而 700 等同于 bold。
以上是目前常用的一些CSS文字样式,希望能够给大家一些帮助。
相关文章: