Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Align bullet points to the right instead of left

Tags:

html

css

I have bullet points that are aligned right and I would like the bullet points to appear on the right instead of left.

I'm using bullet points because I will replace the bullet with an arrow the points to a URL and use it for navigation.

How do I do this?

This is the code that i'm using for the navigation in the header:

.header right {
padding-top: 8px;
float: right;
text-align: right;
}
.header right ul
{
margin:0;
padding:0;
}
.header right a
{
display:block;
color: black;
text-decoration: none;
}

and the html

<right>
<ul>
<li><a href="">Home</a></li>
<li><a href="">Jewel Thieves</a></li>
<li><a href="">Community</a></li>
</ul>
</right>

If I use direction rtl, the bullets dissapeared.

like image 782
Anthony Avatar asked Jan 11 '14 05:01

Anthony


People also ask

How do I move bullet points to the right?

To change the position of the bullets or numbers, drag the first-line indent marker. To change the position of the text, drag the pointed top part of the left indent marker.

Can you right align bullets?

Click one of the alignment options, which are small icons with tiny lines, in the "Paragraph" section of the ribbon/toolbar. Click the "Right Alignment" button to right-align the bullets, click the "Center Alignment" button to center the bullets.


2 Answers

Setting direction: rtl on the list element would put the bullets on the right, but this is fragile, since the setting also sets the overall writing direction. This means that e.g. “foo (bar)” will be displayed as “(foo (bar”, as per the Unicode bidirectional algorithm.

To deal with this, you need to set the direction to left-to-right inside the list items. In the special case that you might have here, each li contains just an a element and nothing more. Then the following would work:

<style>
ul { direction: rtl; }
ul li a { direction: ltr; unicode-bidi: embed; }
</style>

However, this is probably too tricky. It is better to append the list markers (bullets, arrows, whatever) as characters or as images, possibly with CSS, to the list items and omit browser-generated list markers. The details depend on the specifics and context of the original problem.

like image 160
Jukka K. Korpela Avatar answered Sep 30 '22 14:09

Jukka K. Korpela


try this

DEMO

MARK UP:

<div dir="rtl">
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">Jewel Thieves</a></li>
<li><a href="#contact">Community</a></li>
</ul>
</div>
like image 31
Sajad Karuthedath Avatar answered Sep 30 '22 15:09

Sajad Karuthedath