zoukankan      html  css  js  c++  java
  • css vertical-align

    vertical-align指定了行级(inline-level)元素或表格单元格(table-cell)元素在line-box上的垂直对齐方式。

    1.属性值

    .baseline {vertical-align: baseline;}
    .len {vertical-align: 20px;}
    .per {vertical-align: -20%;}
    .top {vertical-align: top;}
    .middle {vertical-align: middle;}
    .bottom {vertical-align:bottom ;}
    .text-top {vertical-align: text-top ;}
    .text-bottom {vertical-align: text-bottom;}
    .inherit {vertical-align: inherit;}
    .sub {vertical-align: sub;}
    .super {vertical-align: super;}

    (1)baseline

    元素的基线与line-box的基线对齐。

    <div>
        属性值<span class="baseline"></span>xxx属性值值。
    </div>

    图1 baseline

    (2)长度值

    以基线为基准,向上(正值)或向下(负值)偏移的距离。

    <div>
         属性值<span class="len"></span>xxx属性值值。
    </div>

    图2 长度值

    (3)百分比

    是按照元素的line-height的值计算基准值的,100%的移动距离等于line-height的值。

    <div>
        属性值<span class="per"></span>xxx属性值值。
    </div>

    图3 百分比

    (4)middle

     元素的中垂线与line-box基线加字母x的1/2的高度对齐。

    <div>
        属性值<span class="middle"></span>xxx属性值值。
    </div>

    图4 middle

    (5)top

    元素的顶端与line-box顶端对齐。

    <div>
        属性值<span class="top"></span>xxx属性值值。
    </div>

    图5 top

    (6)bottom

    元素底端与line-box底端对齐。

    <div>
        属性值<span class="bottom"></span>xxx属性值值。
    </div>

    图6 bottom

    (7)text-top

    元素的顶端与line-box内容区域的顶端对齐。

    <div>
        属性值<span class="text-top"></span>xxx属性值值。
    </div>

    图7 text-top

    (8)text-bottom

    元素的底端与line-box的内容区域的底端对齐。

    <div>
        属性值<span class="text-bottom"></span>xxx属性值值。
    </div>

    图8 text-bottom

  • 相关阅读:
    关于VS2005使用VC++创建MFC智能设备应用程序,总是创建失败解决方法
    远峰E路航V700pro进入wince桌面方法与安装游戏方法
    Arduino IDE上搭建ESP8266环境
    JavaScript Tutorial
    TinyOS Term & Example
    Installation for TinyOS on Ubuntu 16.04
    MySQL Manipulation
    泰勒级数&傅立叶级数(通信层面)
    Choose a different branch in github
    初窥Makefile
  • 原文地址:https://www.cnblogs.com/fe-huahai/p/5633243.html
Copyright © 2011-2022 走看看