zoukankan      html  css  js  c++  java
  • 兩端對齊

    1.利用flex

    parentElement{display: flex;justify-content: space-between;}

    左边对齐
    右边对齐
        <div class="justifySpan">
            <span></span>
            <span></span>
        </div>
    .justify {
            display: -webkit-box;
              display: -ms-flexbox;
              display: -webkit-flex;
              display: flex;
              -webkit-box-pack: justify;
              -ms-flex-pack: justify;
              -webkit-justify-content: space-between;
              justify-content: space-between;
        }

    2. text-align:justify;

    parentElement { text-align:justify;}
    parentElement :after{content:""; display: inline-block;100%;} 主要還是要100% . display:inline-block
    childElement {display: inline-block;} 或者span e a 這種inline 、inline-block標籤

        <div class="justifySpan">
            <span>齐</span>
            <span>齐</span>
        </div>
        .justifySpan {
        text-align:justify;
        text-justify:distribute-all-lines;/*ie6-8*/
        text-align-last:justify;/* ie9*/
        -moz-text-align-last:justify;/*ff*/
        -webkit-text-align-last:justify;/*chrome 20+*/
        }
        .justifySpan:after{
          content:"";
          display: inline-block;
          width:100%;
          overflow:hidden;
          height:0;
        }

     2.2 

    左边对齐
    右边对齐
        <div class="justifySpan">
            <div>左边对齐</div>
            <div>右边对齐</div>
        </div>
    .justifySpan {
        text-align:justify;
        text-justify:distribute-all-lines;/*ie6-8*/
        text-align-last:justify;/* ie9*/
        -moz-text-align-last:justify;/*ff*/
        -webkit-text-align-last:justify;/*chrome 20+*/
        }
        .justifySpan:after{
          content:"";
          display: inline-block;
          width:100%;
          overflow:hidden;
          height:0;
        }
        .justifySpan div{
            display: inline-block;
        }

    3.float:right;float:left;

  • 相关阅读:
    css位置相关元素
    用smarty模板做的登录
    时间查询插件
    smarty 总结和分析
    手风琴特效
    Mysql 知识点总结
    Javascript实现图片的预加载的完整实现
    phpcms 列表页中调用其下的所有子栏目(或特定的子栏目)的方法
    phpcms v9表单实现问答咨询功能
    Cocos2d-x学习之 整体框架描述
  • 原文地址:https://www.cnblogs.com/xieyier/p/4433100.html
Copyright © 2011-2022 走看看