2013-03-11 143 views
0

我有一個輸入字段,我想使用引導警報css類。問題是, 我不能得到那個工作,因爲bootstrap還定義了更具體的選擇器input[type="text"]。所以,那是它?我可以忘記在輸入元素上使用該警報css類?我真的希望避免爲輸入字段創建更具體的css規則...bootstrap css輸入字段

回答

0

您不必「忘記它」,但是您將不得不觸摸一點CSS(或實際上LESS)。

你可以設法做的大部分工作以較少的混入:

input.myInputAlert {  
    .alert; 
} 

賦予大致有以下

input.myInputAlert { 
    /* padding: 8px 35px 8px 14px; */ 
    /* margin-bottom: 20px; */ 
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); 
    background-color: #fcf8e3; 
    border: 1px solid #fbeed5; 
    -webkit-border-radius: 4px; 
    -moz-border-radius: 4px; 
    border-radius: 4px; 
    color: #c09853; 
} 

而且我刪除了填充和保證金規則,讓它使用真正的input值。

而且沒有測試很多,它看起來像它的工作:http://jsbin.com/oqoqeg/2


你可以看到有關LESS編譯there (lesscss.org)

+0

哇,great.I是懶得檢查出較少,但這個我以後肯定會的。 – Zed 2013-03-12 18:59:26