CSS 文本样式

1. 文本样式 text

<!--文本颜色color    -->
.text {color:red;}

2. 文本对齐方式    text-align

<style>
    .text {
        text-align:left;/*向左对齐*/       
    }
    .text {
        text-align:center;/*居中*/
    }
    .text {
        text-align:right;/*向右对齐*/
    }
    .text {
        text-align:justify;/*两端对齐*/
    }
</style>

3. 文本修饰   text-decoration

.decoration {
        text-decoration:none;/*默认样式*/
    }
.decoration {
        text-decoration:overline;/*上划线*/
    }
.decoration {
        text-decoration:underline;/*下划线*/
    }
.decoration {
        text-decoration:line-through;/*删除线*/
    }

4. 字体 font

.text {
        font-family:"微软雅黑";/*字形 微软雅黑*/
        font-size:10px;/*字体大小 10像素*/
        font-style:italic;/*字体样式 斜体 */
        /*字体样式还有
              normal 正常的 
              oblique 倾斜体
        */
    }    

猜你喜欢

转载自www.cnblogs.com/zhoumao/p/9631484.html