likes
comments
collection
share

css实现文字左右两端对齐

作者站长头像
站长
· 阅读数 75

做表单想要实现如下效果。css实现文字左右两端对齐

    span{
      border:1px solid red; 
      width:10em;
      display:inline-block;
      text-align:justify; //需要换行才能有效果,那么我们增加伪类,来实现换行。
      height:19px;//垂直居中
      line-height:19px;//垂直居中
      overflow:hidden;// 让伪类不要显示出来
    }
    span::after{
       content:'';
       width:100%;
       display:inline-block;
    }   
  <span>姓名</span><br>
  <span>联系地址</span><br>
  <span>社会统一信用代码</span>
转载自:https://segmentfault.com/a/1190000041173064
评论
请登录