tags:

views:

39

answers:

3

hi..

i want to align container of the OPTIONS of the select element to the right... the default is showing OPTIONS on the LEFT BOTTOM of the control...

so how will i show OPTIONS aligned to the RIGHT BOTTOM of the select element?

take care...

A: 

If I understand your question:

<select style="text-align:right;">
<option >asd</option>
<option>asdasd</option>
<option>asdasd</option>
<option>asdasd</option>
</select>
GOsha
This aligns the current selected item to the right of the select, but not for the options as he suggested.
ILMV
no no no... i am not talking about the OPTIONS' text.. i am talking about the container of OPTIONS... text is OK..
Jamal Abdul Nasir
2 ILMV - I tried this code in opera. All options was aligned right, not only selected. P.S.>Sorry for my english
GOsha
2 Jamal Abdul Nasir:why not to use this style options to your container?
GOsha
i cant align TEXT to RIGHT bcoz it gets away from my screen's right edge..
Jamal Abdul Nasir
please update your question and give your html-code to see the problem.
GOsha
A: 
<option value="1" style="text-align: right;">
test?</option>
vertazzar
This doesn't work
ILMV
no no no... i am not talking about the OPTIONS' text.. i am talking about the container of OPTIONS... text is OK...
Jamal Abdul Nasir
@ILMV ye sorry, i was thinking to say <select style=... but apparently i was mind-drunk
vertazzar
A: 

While the other answers are correct, and you can use the style attribute, you'd be better off using an external CSS file.

In your HTML document, add a <link> to your CSS file in the <head> of the document:

<head>
    <title>Example</title>
    <link type="text/css" rel="stylesheet" href="path/to/the/file.css" />
</head>

Give your <select> (or the <option>) element a class attribute.

<select class="JamalAbdulNasir">
    <option class="Jamal">Jamal</option>
    <option class="Abdul">Abdul</option>
    <option class="Nasir">Nasir</option>
</select>

In your style sheet include a CSS rule which targets that <select> tag by class attribute.

select.JamalAbdulNasir {
    text-align:right;
}

... or the <option> tag you want to be right-aligned.

input.Abdul {
    text-align:right;
}
LeguRi
sir this is also OK... but i dont want this... what i want is to align the RIGHT TOP of the whole container of OPTIONS to the RIGHT BOTTOM of the select element.i hope u got it..
Jamal Abdul Nasir
I totally don't understand :(
LeguRi