I have HTML markup with a text paragraph in the body
element. In the CSS stylesheet, I added:
body {
text-align: justify;
color: black;
background-color: white;
font-size: 23;
letter-spacing:0.05pt;
line-height: 125%;
font-size: 1.25em;
margin: 0.00em 20em;
text-indent: 0em;
font-weight: normal;
font-style: normal;
direction: rtl;
}
When I load it in Safari 10.1, the text goes outside of the body border. But the same markup in an older version of Safari (10.0) works fine and in Chrome 56.0.2924.87 (x86_64).
How do I fix the markup and style in order for this to work in the new Safari?
All replies. Safari has no notion of text alignment as it is not a text editor or word processor. The default behavior for an HTML form input field is left alignment. The web designer must override this default with CSS styling to achieve right, or center alignment.
Short answer: your text isn't centered because the elements are floated, and floated elements "shrink" to the content, even if it's a block level element.
To get the left justified text you would use text-align: justify; in you css. In the latest versions of Chrome and IE you get justified text with the last line being left aligned using that css.
it's officially a safari 10.1 bug. you can rate this post on apple communities maybe they fix it sooner . safari 10.1 text-align: justify Bug
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With