CSS的文本属性

发布时间 2023-09-23 10:29:54作者: songs7

1.指定元素文件的水平对齐方式:text-align(left right center)

2.text-decoration:文本修饰(underline下划线 overline 上划线 line-through 删除线)

3.text-transform:控制文本的大小写:(captialize 开头大写  uppercase 所有字母大写 lowercase 所有字母小写)

4.text-indent:规定文本首行缩进

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
            .xxx{
                text-align: center;
                text-decoration:underline;
            }
            .xx{
                text-align: center;
                text-transform: capitalize;
            }
            .xxxx{
                text-indent: 20px;
            }
    </style>                    <!--文本居中 文本下划线--><!--文本居中 文本首字母大写--><!---首行缩进-->
</head>
<body>
    <p class="xxx">555555555</p>
    <p class="xx">hello world</p>
    <p class="xxxx">噢噢噢噢噢噢噢噢噢噢噢噢噢噢噢噢哦哦哦</p>
</body>
</html>