2013-10-28 284 views
1

我確實有一個WordPress默認輸入CSS。覆蓋默認CSS屬性

input, input[type="text"], input[type="password"], input[type="datetime"],  input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input { 
border: none !important; 
background-color: #f0efed; 
line-height: 40px; 
font-size: 16px; 
color: #555; 
border-radius: 0px; 
-moz-border-radius: 0px; 
-webkit-border-radius: :0px; 
box-shadow: none !important; 
-webkit-box-shadow: none !important; 
-moz-box-shadow: none !important; 
box-sizing: border-box; 
-moz-box-sizing: border-box; 
-webkit-box-sizing: border-box; 
height: 40px; 
} 

我想覆蓋輸入樣式,如'文本'和'提交'只在一個特定的div。

樣本HTML:

<div class="checkout_page_container"> 
<table class="checkout_cart"> 
<tr> 
<td><input type="text" /></td> 
</tr> 
</table> 
</div> 

我想這個CSS。但他們不會工作..

.checkout_page_container .checkout_cart input[type="text"] { 
border: 1px solid #666; 
} 

.checkout_page_container .checkout_cart input[type="submit"] { 
border: 1px solid #ccc; 
color:#000; 
} 

當我做引入元素。瀏覽器仍然檢測到主題的默認輸入樣式。

回答

3

在wordpress主題中它有「border:none!important;」 !重要意味着它不會被優先級更高的樣式覆蓋。

您可以刪除修復它,但它可能會破壞網頁上的其他事情(!重要的是有點髒,不是好的做法在大多數情況下,所以它可能被用於一個原因)

0

使用「mystyle:value!important」,並將代碼放置在WordPress樣式表的下面。這將覆蓋WordPress的樣式。

+0

我聽說使用!重要的是有點危險? –

+0

@JeremiLiwanag不是我所知道的。我只在必要時使用!重要。 – sheng