2013-07-15 88 views
0

我想爲主題設計portfolio開發一個兒童主題,爲此我創建了一個名爲'mychild'的文件夾,並將style.css放入其中,就像theme/mychild/style的CSS。WordPress的兒童主題風格過了父母的主題風格

/* 
Theme Name:  proudeon 
Theme URI:  http: //www.presscoders.com/designfolio 
Description: Child theme for the Designfolio theme 
Author:   sunilkumar 
Author URI:  http: //www.presscoders.com/ 
Template:  designfolio 
Version:  0.1.0 
*/ 

@import url("../designfolio/style.css"); 
#header { 
height: 450px; 
border:1px solid red; 
} 
#header-container, .footer-widget-container{ 
background: none repeat scroll 0 0 red;  
} 

但變化不會反映。我已經成功安裝了子主題,我可以修改我的孩子從主題WordPress的編輯器的style.css。

我可以從firebug檢查元素中看到新的子樣式,但它不是主動的。當我從螢火蟲檢查元素隱藏父級樣式時,我可以看到網站中反映的新樣式。

請幫我找出問題

感謝 驕傲

回答

1

嘗試增加!每個風格線上的重要。

例如:

#header { 
height: 450px !important; 
border:1px solid red !important; 
} 
+0

添加'important'的樣式規則應該僅僅是一個不得已而爲之。您應該閱讀CSS特定性(https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity),因爲這是處理樣式規則優先級的更好方法。 –