Home >Web Front-end >HTML Tutorial >Text alignment problem_html/css_WEB-ITnose

Text alignment problem_html/css_WEB-ITnose

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


The text is in

under
, text-align is set to justify, and the left and right margins of
are 0, but in fact there is a gap on the right side of the text, left and right The distance between the two sides is not equal to the browser boundary. How to solve this problem? Moreover, the display of Chinese and English text is not ideal.


Reply to discussion (solution)

You can try margin-left or padding-left. Whichever works, try it yourself.

It is best to paste the code at the same time as the picture. Who knows how to write your code?

text-align:justify;text-justify:inter-ideograph;
That’s it

It is best to paste the code at the same time as the picture. Who knows how to write your code?

text-align:justify;text-justify:inter-ideograph;
That is Available






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;
}

Alignment is based on the situation of the words, because you can’t put a word on the right side, (use the first line as an example), so the “no” is there The second line, this is normal. I can only say that your setting is not good enough. You should set the width of the div to an integer multiple of the width of the word, so that the two ends are aligned without gaps. As for the English, it is the same Reason

Alignment is based on the situation of the words, because you can’t put a word on the right side, (use the first line as an example), so the “no” goes to the second line, This is normal. It can only be said that your setting is not good enough. You should set the width of the div to an integer multiple of the width of the word, so that the two ends are aligned without gaps. As for the English, the same reason





Text size 1em, width 12em, still not working

Set letter-spacing to 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