zoukankan      html  css  js  c++  java
  • (转)CSS定义字体间距 字体行与行间距

    源网址:http://www.cnblogs.com/jian1982/archive/2010/07/03/1770349.html

    CSS定义字体行间距 line-height:xxpx;

    CSS定义字体间距

    下面我们讲述一下CSS的文本属性,还是先来看一下文本属性的详细列表:

    属性 属性含义 属性值
    Word-spacing 定义了各个单词之间的间距 Normal<length>必须以长度为单位
    Letter-spacing 定义了每个字母之间的间距 同上
    Text-decoration 定义文字的“装饰”样式

    None|underline|overline|

    line-through|blink

    Vertical-align

    定义了元素在垂直方向

    上的位置

    Baseline|sub|super|top|text-top|middle|bottom|text-bottom

    <percentage>

    text-transform 使文本转换为其它形式 Capitalize|uppercase|lowercase|none
    Text-align 定义了文字的对齐方式 Left|right|center|justify
    Text-indent 定义了文本的首行的缩进方式 <length>|<percentage>
    Line-height 定义了文本的行高

    Normal|<unmber>|<length>|

    <percentage>

    我们可以从表中看到在这里可以定义文本的文字间距、字母间距、装饰、对齐方式、缩进方式和行高等属性。

    举个例子来看看吧:

    CODE:

    <p style="letter-spacing:5px;text-align:justify;text-indent: 4em;line-height:17pt">我们看到经过文本属性处理的文本字与字之间多了间距,行与行之间多了行高,对齐方式变成了两端对齐,并且段首又多缩进了两格。</p>

    letter-spacing设置了字间距为5px,其中5px为一个长度单位;text-align设置了对齐方式为两端对齐;indent设置了缩进格为4em;line-height设置了行高为17pt

    从上面的例子,我们可以看出利用CSS的文本属性可以方便的对页面中的文本进行排版。

  • 相关阅读:
    Karen and Game CodeForces
    Array and Segments (Easy version) CodeForces
    Diverse Garland CodeForces
    Nice Garland CodeForces
    Divisors of Two Integers CodeForces
    Two distinct points CodeForces
    Unique Snowflakes UVA
    Codeforces Round #534 (Div. 2)D. Game with modulo-1104-D(交互+二分+构造)
    关于排列组合问题的基础补充
    杭电 rescue(经典广搜)(深搜广搜对比)
  • 原文地址:https://www.cnblogs.com/fengzhentian/p/4576336.html
Copyright © 2011-2022 走看看