CSS Text

作者: roy_pub | 来源:发表于2018-11-26 21:46 被阅读11次
color

定义文本的颜色,取值有三种方式

  • 预定义颜色值,如 green, blue 等
  • 十六进制,如 #FFFFFF,#29DF74 等
  • RGB,如 rgb(222, 123, 45) 或 rgb(0%, 45%, 23%)
line-height

设置行高,单位一般用 px

text-align

设置文本内容的水平对齐

  • left 左对齐
  • right 右对齐
  • center 居中对齐
text-indent

设置文本首行缩进,建议使用 em 设置单位。1em 就是一个字的宽度,如果是汉字,1em 就是一个汉字的宽度。

text-decoration

常用于给链接修饰装饰效果

  • none 默认,定义标准的文本
  • underline 定义文本的下划线,下划线也是链接自带的
  • overline 定义文本的上划线
  • line-through 定义穿过文本的一条线
<!DOCTYPE html>
<html lang="en">
<head>
    <style type="text/css">
        .decNone {
            text-decoration: none;
        }

        .decUnderline {
            text-decoration: underline;
        }

        .decOverline {
            text-decoration: overline;
        }

        .decThrough {
            text-decoration: line-through;
        }
    </style>
</head>
<body>
    <p class="decNone">This is china</p>
    <p class="decUnderline">This is china</p>
    <p class="decOverline">This is china</p>
    <p class="decThrough">This is china</p>
</body>
</html>

相关文章

  • 常见的Content-Type字段的值

    text/plain text/html text/css image/jpeg image/png image/...

  • CSS阴影

    CSS阴影 标签(空格分隔): CSS Text-Shadow text-shadow属性赶走了用Photosho...

  • hover

    CSS的hover选择器 id .text{ class=’text’的元素的样式} id:hover .text...

  • CSS Text

    https://developer.mozilla.org/zh-CN/docs/Web/CSS/CSS_Text

  • CSS Text

    color 定义文本的颜色,取值有三种方式 预定义颜色值,如 green, blue 等 十六进制,如 #FFFF...

  • CSS-属性&&选择器

    CSS选择器、CSS属性 css的固定格式: 注意点: style写在head中间,type="text/css"...

  • css3文字效果

    今天和大家分享css3的阴影文字 css3里的文字阴影属性,text-shadow 语法:text-shadow:...

  • CSS3文本效果

    CSS3 text-justify 属性 text-justify 属性规定当 text-align 被设置为 t...

  • webpack 插件使用总结

    extract-text-webpack-plugin 用途:提取单独css文件不使用extract-text-w...

  • CSS使用汇总

    CSS样式技巧 div居中显示:text-align与margin配合 {text-align: center; ...

网友评论

    本文标题:CSS Text

    本文链接:https://www.haomeiwen.com/subject/pplpqqtx.html