2013-05-30 42 views
0

在我的JSP頁面中我有一個選擇框對齊選項

<select id="subjectArea" name="subjectArea" class="inputstyle"> 
    <option value="choose"><s:text name="global.generic_feed_target_choose" /></option> 
    <option value="subjArea">Subject Area</option> 
</select> 

它的CSS是

select.inputstyle{ 
    width: 177px !important; 
    height: 26px !important; 
    margin-top: 5px !important; 
    direction: rtl !important; 
} 

但問題是,選擇框中的選項也是對齊的。

You can see here

我想要的選項,在左對齊。我怎樣才能做到這一點?

回答

0

你需要這樣的東西嗎?如果是比使用text-align: left;對齊文本選項框中向左,如果你正在尋找別的東西,不是請讓我知道你的問題不是很清楚

Demo

select.inputstyle{ 
    width: 177px !important; 
    height: 26px !important; 
    margin-top: 5px !important; 
    direction: rtl !important; 
    text-align: left; 
} 

注意:您未關閉name屬性 - >name="subjectArea"

+0

我試過了。它不工作。當我在這裏複製代碼並錯誤地編輯了雙引號時。 :) –

+0

@ShijuKBabu你看過我的演示了嗎?它工作 –

+0

我看到了。我也嘗試過。它沒有工作。我想知道爲什麼 –