Opera OL bad text align with justify

2019-05-31 10:33发布

问题:

I'm having a problem with justify alignment of list items (<li>) in an ordered list (<ol>) in Opera. There are different spacings in front of the lines.

Opera version:

  • Version: 11.62
  • Build: 1347
  • Platform: Win32
  • System: Windows 7

Screenshots:

(reproduced at jsfiddle.com)

Test code: http://jsfiddle.net/ySmJZ/

ol {
  list-style: decimal;
  margin: 16px 0px;
  padding: 0px 0px 0px 40px;
  text-align: justify;
}

回答1:

It's a known bug in Opera (CORE-41499). There isn't really a workaround, except to avoid using text-align:justify.



回答2:

Yes, this is a known bug in Opera (even in 12.01 (x86)), but there IS a workaround, written by deathshadow here:
http://my.opera.com/community/forums/topic.dml?id=1424852&t=1347118644&page=1#comment12696422

Citing:

"One workaround (until/if they fix it) is an extra SPAN or DIV inside the LI wrapping all the content set to display:inline-block; vertical-align:top;"

I tried it, and it really works (at least in Opera 12.01 (x86)):

http://jsfiddle.net/Sk8erPeter/ySmJZ/10/

BEFORE

AFTER