How I can align a text/pargaph both to left and right in HTML? Like in the office programs.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
text-align: justify;in cssbut beware: unlike in proffesional
DTP applicationsor even in word, HTML/browser often do not play nicely with this – you might end having humongous gaps in your text, completely destroying any typogtaphy you try to achieve in your document.Edit:
As reply to Brian, my experiences are following:
%for width, because I either set width inpxor not at all and letdisplay:block;element fill whole width of parenttext-align: justifyworks best with smallfont-sizewith slightly higherline-height–line-heightis for readbility and smaller font size puts more characters in one line (abstract characters-per-line width), therefore gaps between words/justified text looks betterCufón, if you learn to count with it’s consEdit2:
The main problem is, that browsers don’t know how to part your text (i.e. unbreakable to un-breakable) – soft hyphyen,
­should solve this (link: soft hyphen overview), but browser support is wild at best 🙂