Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bullet Points Positioning with Arabic RTL direction

I am using custom bullet points on a website. Now this site will also be available in Arabic.

.post ul li{
    color: #555555;
    background: url(images/ico-bullet_round.gif) no-repeat !important;
    background-position: 300px 6px !important;
    padding-right: 15px !important;
    padding-left:0 !important;
    direction:rtl;
}

However with direction:rtl; I am unable to have all the bullet points on the right side. Some are more indented than others.

Please see a screenshot showing the problem.

Any suggestions on how to simply align all bullet points on the right?

UPDATE: Please see this screenshot with background-position set to 0 6px. It has something to do with direction:rtl; but I can't figure it out.

alt text

like image 513
Julian Avatar asked Oct 16 '10 20:10

Julian


People also ask

How do you RTL?

Internet Explorer: Use CTRL+LEFT SHIFT for LTR and CTRL+RIGHT SHIFT for RTL.

What is RTL and LTR?

For example, the en-US locale (for US English) specifies left-to-right. Most Western languages, as well as many others around the world, are written LTR. The opposite of LTR, RTL (Right To Left) is used in other common languages, including Arabic ( ar ) and Hebrew ( he ).

What does direction RTL do?

The direction CSS property sets the direction of text, table columns, and horizontal overflow. Use rtl for languages written from right to left (like Hebrew or Arabic), and ltr for those written from left to right (like English and most other languages).


3 Answers

Is there any reason why not simply list-style-image, which is designed specifically for custom bullets?

ul { margin: 0 20px; padding: 0; }
ul li {
    margin: 0; padding: 0;
    list-style: disc url(images/ico-bullet_round.gif);
    direction:rtl;
}

works for me, assuming you do mean the right-hand side when you say “right side”. You could have them on the left as well if you wanted by putting the rtl on a child div inside the li, but that'd look a bit strange for Arabic, I think.

like image 72
bobince Avatar answered Sep 19 '22 07:09

bobince


I had the same problem and got over it by using:

ul{direction:rtl;}
li{direction:rtl; margin-right:20px;}

The functioning attribute is using: margin-right:20px while using direction :rtl

Thanks

like image 43
mohammad Avatar answered Sep 20 '22 07:09

mohammad


One solution could be to put background-position like this: background-position: 100% 6px !important;

I supppose that the direction: rtl, does not influence in backgrounds.

like image 25
netadictos Avatar answered Sep 19 '22 07:09

netadictos