css

18、CSS文本样式

yu
yu
2024-09-30 / 0 评论 / 4 阅读 / 正在检测是否收录...
<!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>CSS文本样式</title>

    <style>
        /*
            一、文本相关属性

                1.color:设置文本颜色

                2.text-align 设置文本水平对齐方式
                    可选值:
                        left 左对齐(默认值)
                        right 右对齐
                        center 居中
                        justify 两端对齐

                3.text-decoration 设置文本装饰
                    可选值:
                        none 无装饰(默认值)
                        underline 下划线
                        overline 上划线
                        line-through 删除线

                4.text-indent 用于设置文本第一行的缩进
                    单位:px % em

                5.text-transfrom
                    设置字母大小写显示
                        none 无装饰(默认)
                        uppercase 大写显示
                        lowercase 小写显示
                        capitalize 首字母大写

                6.letter-spacing 设置字符之间的距离
                7.word-spacing 设置单词之间的距离

                8.line-height 设置行之间的距离(行间距,行高)
                    行高=上间距+下间距+字体大小
                    行间距=下间距+上间距(行高-字体大小)

        */
        p{
            color:red;
            font-size: 20px;
            text-align:justify;
            text-decoration:none;
            text-indent: 2em;
            text-transform: capitalize;
            letter-spacing:5px;
            word-spacing: 20px;
            line-height: 80px;

        }
    </style>
</head>
<body>
    <p>我想做个好人Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit expedita inventore tempore neque odit nemo qui molestiae. Inventore cupiditate ex similique harum minus, quas minima earum fuga aliquam sit <placeat class="lorem">
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Similique illum nisi minus exercitationem aut quisquam dignissimos, voluptates vero ea fugit possimus repellendus in, voluptas ipsum id fugiat, reiciendis molestiae <perspiciatis class="lor">
            Lorem ipsum dolor sit, amet consectetur adipisicing elit. Sint ad distinctio ut pariatur asperiores, assumenda est consectetur, necessitatibus qui consequatur totam repellat esse atque commodi fuga sapiente modi delectus! At.
        </p>
</body>
</html>
0

评论 (0)

取消