IE9 RTL Positioning

Fiddle: http://jsfiddle.net/bHRVe/

A sprite is used for the arrow. The background position in Firefox and IE8 is great:

Ff screenshots

However, the RTL direction seems to drop IE9, the arrows are gone:

IE9 Screenshot

If I changed the positioning from left -52px to right -52px , then it will display correctly in IE9, but breaks in other browsers.

Is there a way to fix this using the same CSS? (no conventions or hacks)

+4
source share
2 answers

Just change your CSS a bit:

 .button span { background: url("http://i48.tinypic.com/16716yb.png") no-repeat scroll left -52px transparent; margin-right: 0.5em; direction: rtl; display: inline-block; width: 10px; height: 16px; } 

Living example . Tested and works in IE9, Chrome, Firefox, Safari and Opera :)

+1
source

Here is a clean CSS based solution:

CSS

 .button span { background: url("http://i48.tinypic.com/16716yb.png") no-repeat 0 -52px; margin-right: 0.5em; padding: 0 5px; direction: rtl; width:4px; height:15px; display:inline-block; } 

HTML:

Note. Itโ€™s good practice if you put a space (   ) in an empty element, because for a while it helps in browser compatibility.

 <a class="button" href="#"> <b>ุชู…, ุบุฒูˆ ุนู„ ุฌู†ูˆุจ</b> <br/> <u>ุจ ุงู†. Testู…ุง ูˆุต</u> <span>&nbsp;</span> </a> 

Additional notes: By default, <span> and <a> elements are inline elements. we need to make them display:block; or display:inline-block; using css according to our need.

In your case, you can also use display:block; but then you need to add float:left to make the span in the right place.

Screen shot: IE9

enter image description here

+2
source

All Articles