Home  >  Article  >  Web Front-end  >  文字两端对齐的问题_html/css_WEB-ITnose

文字两端对齐的问题_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:02:261190browse


文字是在

下的
里,text-align设置为justify,
的margin左右为0,但是实际上文字的右边会有一段空隙,左右两边距离浏览器边界不相等,这个问题要怎么解决?而且文字中英文的显示也很不理想


回复讨论(解决方案)

可以试一下margin-left或是padding-left。哪个有效果,自己试试吧。

贴图的同时最好贴代码啊,谁知道你的代码怎么写的啊

text-align:justify;text-justify:inter-ideograph;
即可

贴图的同时最好贴代码啊,谁知道你的代码怎么写的啊

text-align:justify;text-justify:inter-ideograph;
即可







文字






css:
section {
margin: 0;
}
#banner2 {
padding: 6em 0;
text-align: center;
}
#banner2 .inner {
background: none;
display: block;
padding: 0 1.5em;
text-align: center;
}

#banner2 .inner footer {
margin-top: 2em;
margin-right: auto;
margin-left: auto;
text-align: center;
}

#banner2 .inner p {
text-align: justify;
margin: 0;
}

两端对齐是根据字的情况来的,因为你的右边放不下一个字了,(用第一行举例)所以那个“不”就到第二行了,这是很正常的   只能说你设置的不够好,你应该吧div的宽度设置成字的宽度的整数倍,这样就是无间隙的两端对齐了,至于那个英文,一样的道理

两端对齐是根据字的情况来的,因为你的右边放不下一个字了,(用第一行举例)所以那个“不”就到第二行了,这是很正常的   只能说你设置的不够好,你应该吧div的宽度设置成字的宽度的整数倍,这样就是无间隙的两端对齐了,至于那个英文,一样的道理





文字大小1em,宽度12em,还是不行

letter-spacing设为0

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn