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...
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...
If I understand your question:
<select style="text-align:right;">
<option >asd</option>
<option>asdasd</option>
<option>asdasd</option>
<option>asdasd</option>
</select>
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;
}