css兼容的文本分散两端对齐

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        div{
            width: 90px;
            height: 20px;
            border: 1px solid grey;
            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+*/
        }
        @media screen and (-webkit-min-device-pixel-ratio:0){ /*兼容chrome*/
            div:after{
                content:".";
                display: inline-block;
                width:100%;
                overflow:hidden;
                height:0;
            }
        }
    </style>
</head>
<body>
<div>文本两端对齐</div>
</body>
</html>
posted @ 2015-07-17 16:24  菩提明镜  阅读(416)  评论(0编辑  收藏  举报