Created
June 1, 2018 01:34
-
-
Save 337547038/c82ae9d9eda50c5088357adfb1d0fe26 to your computer and use it in GitHub Desktop.
CSS如何实现文字两端对齐
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
在排版表单字段时,很多时间字数不一,如下: | |
用户名: | |
密码: | |
手机号码: | |
要实现前面的文字两端对齐,有个傻傻的办法就是在文字中间用空格隔开; | |
解决办是: | |
<div>用户名:</div> | |
css如下: | |
div{ text-align:justify; width:100px;} | |
div:after{ display:inline-block;width:100%;content:""} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment