CSS文本属性

 文本颜色color

以下为三种表示方式,一般用第二种

<style>
        body {
            color: red;
            color: ff0000;
            color: rgb(255, 0, 0);
        }
</style>

文本对齐text-align

<style>
        body {
            text-align: left;/* 左对齐(默认对齐方式) */
            text-align: right;/* 右对齐 */
            text-align: center;/* 居中对齐 */
        }
</style>

文本装饰text-decoration

<style>
        body {
            text-decoration: none;/* 没有装饰线(默认值) */
            text-decoration: underline;/* 下划线 */
            text-decoration: overline;/* 上划线 */
            text-decoration: line-through;/* 删除线 */
        }
 </style>

文本缩进 text-indent

 使文本第一行首行缩进多少距离

em指当前元素一个文字的大小,若一个字大小为12px,2em表示缩进两个字,即24px

<style>
        body {
            text-indent: 12px;
            text-indent: 2em;
        }
</style>

行间距line-height

<style>
        body {
            line-height: 26px;
        }
</style>

 

初学者,见解不足,如有错误请指出

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值