首页 > web前端 > html教程 > css3 中text-align:justify_html/css_WEB-ITnose

css3 中text-align:justify_html/css_WEB-ITnose

WBOY
发布: 2016-06-21 09:08:50
原创
1192 人浏览过

css3中text-align:center:justify;

这个属性是单词两端对齐的意思。 

值justify可以使文本的两端对齐。在两端对齐的文本中,文本行的左右两端都放在父元素的内边界上。然后,调整单词和字符间的间隔,使各行的长度恰好相等。

举例:

<!DOCTYPE html><html>  <head>    <meta charset="utf-8">    <title>css中display:justify</title>    <style>    .box1{ width:500px; line-height:20px; margin:10px auto; background-color:#cdd; text-align:justify;}    .box2{ width:500px; line-height:20px; margin:10px auto; background-color:#cdd; text-align:left;}    </style>  </head>  <body>      <div>There is clearly a need for CSS to be taken seriously by graphic artists. The Zen Garden aims to excite, inspire, and encourage participation. To begin, view some of the existing designs in the list. Clicking on any one will load the style sheet into this very page. The code remains the same, the only thing that has changed is the external .css file. Yes, really</div>      <div>There is clearly a need for CSS to be taken seriously by graphic artists. The Zen Garden aims to excite, inspire, and encourage participation. To begin, view some of the existing designs in the list. Clicking on any one will load the style sheet into this very page. The code remains the same, the only thing that has changed is the external .css file. Yes, really</div>  </body></html>
登录后复制

效果图:

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板