Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Safari 10.1 – text-align: justify text goes outside the border in RTL languages

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?

like image 319
Ido Meirov Avatar asked Apr 03 '17 09:04

Ido Meirov


People also ask

How do I align text in 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.

Why text-Align Center doesn't work?

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.

How do I justify text left in CSS?

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.


1 Answers

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

like image 97
reza saeb Avatar answered Sep 22 '22 14:09

reza saeb