我怎么能改变列表框上的对齐方式

时间:2015-02-12 09:08:11

标签: html css

就像我在标题上所说的那样。如果您在下面的代码中注意到,我尝试使用text-align

<SELECT style="font-size: 32px; 

           margin-left: 5px;
           text-shadow: 1px 0px 3px gray;
           font-family: Times New Roman;
           height: 43px;
           width: auto;`enter code here`
           color: #000;
           font-weight: bold;
           border: none;
           background-color: transparent;
           text-align:center;">

<OPTION Value="">CLASSROOM RATIO</OPTION>
<OPTION Value="">ENROLMENT END OF SCHOOL YEAR</OPTION>
<OPTION Value="">ENROLEMNT OF ALS LEARNERS</OPTION>
<OPTION Value="">FURNITURE RATIO</OPTION>
<OPTION Value="">NUMBER OF CLASSES BY SHIFT</OPTION>
<OPTION Value="">NUMBER OF CLASSES</OPTION>
<OPTION Value="">NUMBER OF COMPLETERS/PROMOTEES/GRADUATES</OPTION>
<OPTION Value="">NUMBER OF DROPOUTS</OPTION>
<OPTION Value="">NUMBER OF TEACHERS BY GRADE LEVEL</OPTION>
<OPTION Value="">NUMBER OF TRANSFEREES IN</OPTION>
<OPTION Value="">NUMBER OF TRANSFEREES OUT</OPTION>
<OPTION Value="">TEACHER DEPLOYMENT</OPTION>


</SELECT>

out就像这样:

 __________________________________
|CLASS ROOM RATIO                  |
```````````````````````````````````

我希望我的列表项目位于中心位置:

 __________________________________
|        CLASS ROOM RATIO          |
```````````````````````````````````

我一直在寻找4小时,有人可以给我这个代码的答案吗?请帮帮我。

1 个答案:

答案 0 :(得分:1)

无法使用text-align对齐它。 所以唯一的出路就是使用text-indent

option
{
    text-indent: 5px; 
}

将以上内容添加到您的选项的css