选择标签的OPTIONS右对齐 [英] select tag's OPTIONS aligned right
问题描述
我想将选择元素的OPTIONS的容器向右对齐...默认情况下,在控件的左下角显示OPTIONS ...
虽然其他答案是正确的,你可以使用 style
属性,你最好使用外部CSS档案。
在HTML文件中,将< link>
$ c>< head> :
< head>
< title>示例< / title>
< link type =text / css =stylesheethref =path / to / the / file.css/>
< / head>
提供< select>
< option>
)元素a class
属性。
< select class =JamalAbdulNasir>
< option class =Jamal> Jamal< / option>
< option class =Abdul> Abdul< / option>
< option class =Nasir> Nasir< / option>
< / select>
在您的样式表中包括一个CSS规则,目标是< select& c>
$ b $
.JamalAbdulNasir {
text-align:right;
}
...或< option& / code>标签。
input.Abdul {
text-align :对;
}
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...
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;
}
这篇关于选择标签的OPTIONS右对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!