2012-06-10 55 views
0

请问我有手吗?我正在努力克服Wordpress Custom Fields Search插件中的CSS,该插件似乎对出现在窗口小部件和页面中的搜索框使用相同的样式。如果您查看http://www.landedhouses.co.uk/parties/,白色文本可通过小部件中的搜索框显示,但在页面上不可见。任何想法如何解决这一问题!?不幸的是,将此添加到页面的php没有实现任何内容:CSS搭配Wordpress插件

<h2>By size and price</h2> 
<p style="color:000;"><?php if(function_exists('wp_custom_fields_search')) 
wp_custom_fields_search(); ?></p> 

非常感谢!

回答

0

这是造成您问题的样式规则。

/* searchforms.css line 15 */ 
.searchform-label { 
    display: block; 
    float: left; 
    width: 200px; 
    overflow: hidden; 
    font-size: 1.1em; 
    font-family: sans-serif; 
    font-weight: bold; 
    padding-top: 4px; 
    color: white; 
} 

你可以用css做一些事情。您可以在样式表的覆盖规则:

.searchform-label { 
    color: black; 
} 

如果不工作,你可以做出更具体的规则:

label.searchform-label { 
    color: black; 
} 

,或者你可以在最坏的情况下作出的!important规则。

.searchform-label { 
    color: black !important; 
} 
0

作为扩展上述答案的(我还不能发表评论:()

一般来说,一个更具体的规则将覆盖如果原来没有使用属性!重要的是,

所以你只需要定位一些更具体的东西,比如label.searchform-label,如果这不起作用,那么包含一个直接的父元素和一个>,例如,如果标签被包装在一个P ,使用p>label.searchform-label

应该很少有必要!重要的,尽管他们应该做一个!不重要,容易覆盖:D

+0

Oooh - 这只是工作:label.searchform-label {color:black;}然而,为什么呢工作?当然,小部件和页面都使用标签class = searchform-label?谢谢 – Edmund

+0

因为label.searchform-label比.searchform-label更具体,所以值可以覆盖任何非重要的规则,就像{parent}> label.searchform-label将覆盖label.searchform-label中的规则,即对于更具体的选择器,规则将被使用的可能性更大 希望这有助于:) – Jamie