CSS文本属性

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文本属性</title>
    <style>
         .p1 { color: red; } /* 文字颜色 */
         .p2 { font-family: "华文中宋"; } /* 字体类型 */
         .p3 { font-size: 26px; } /* 文字大小 */
         .p4 { font-weight: bold; } /* 文字加粗 */
         .p5 { font-style: italic; } /* 文字倾斜 */
         .p6 { text-indent: 60px; } /* 首行缩进 */
         .p7 { text-align: center; } /* 水平对齐方式 */
         .p8 { line-height: 100px; } /* 行高 */
         .p9 { height: 100px; background-color: gray; line-height: 100px; } /* 利用行高将文字垂直居中 */
         .p10 { text-decoration: underline; } /* 文本修饰 */
    </style>
</head>
<body>
    <ul>
        <li class="p1">深圳</li>
        <li class="p2">上海</li>
        <li class="p3">北京</li>
        <li class="p4">广州</li>
        <li class="p5">长沙</li>
        <li class="p6">杭州</li>
        <li class="p7">武汉</li>
        <li class="p8">成都</li>
        <li class="p9">洛阳</li>
        <li class="p10">海口</li>
    </ul>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值