2013-10-28 286 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