美文网首页
文本样式和文本的修饰

文本样式和文本的修饰

作者: 优秀的人A | 来源:发表于2018-11-20 22:25 被阅读21次

    text-transform

    1.默认文本样式

    p{
      text-transform:none;
    }
    

    2.capitalize 文本中的每个单词以大写字母开头。

    p{
      text-transform:capitalize;
    }
    

    3.uppercase 定义仅有大写字母。

    p{
      text-transform:uppercase;
    }
    

    4.lowercase 定义无大写字母,仅有小写字母。

    p{
      text-transform:lowercase;
    }
    

    text-decoration

    1.默认文本样式

    p{
      text-decoration:none;
    }
    

    2.underline 定义文本下的一条线。

    p{
      text-decoration:underline
    }
    

    3.overline 定义文本上的一条线。

    p{
      text-decoration:overline;
    }
    

    4.line-through 定义穿过文本下的一条线。

    p{
      text-decoration:line-through;
    }
    

    5.去除超链接的下划线

    a{
      text-decoration:none;
    }
    

    6.letter-spacing用来设置字符之间的间距

    p{
      letter-spacing:10px  
    }
    

    7.work-spacing用来设置单词之间的间距

    p{
      work-spacing:10px
    }
    

    对齐文本

    text-align

    可选值
    1.left : 左对齐
    2.right: 右对齐
    3.justify: 两边对齐
    4.center: 居中对齐

    p{
      text-align:left;
    }
    在left处更换可选值right justify center
    

    首航缩进

    text-indent

    p{
      text-indent:32px;
    }
    没有设置字号,浏览器默认16px;
    
    如果我就想制作无论字号多大就缩进两个字的就要em单位
    注:1em = 1font-size;
     p{
      text-indent:2em;
      font-size:30px;
    }

    相关文章

      网友评论

          本文标题:文本样式和文本的修饰

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