[英]CSS Selectors to Apply Border to h4
On http://adasportsandrackets.com/wordpress , I am trying to add CSS to add a border under the h4 heading "Best Sellers." 在http://adasportsandrackets.com/wordpress上 ,我试图添加CSS在h4标题“畅销书”下添加边框。 It's not working and it's not a caching issue as I've tried in the major browsers after deleting cache.
如我在删除缓存后在主要浏览器中尝试过的那样,它不起作用,也不是缓存问题。
Here is the HTML: 这是HTML:
<div class="wpb_text_column wpb_content_element best-sellers">
<div class="wpb_wrapper">
<h4>Best Sellers</h4>
And here is my CSS: 这是我的CSS:
.best-sellers h4 {
border-bottom: 1px solid #eee;
padding: 7px 0px;
}
I also tried: 我也尝试过:
.best-sellers {
border-bottom: 1px solid #eee;
padding: 7px 0px;
}
This worked for me: 这对我有用:
.page-template-template-home-default-php .wpb_wrapper h4 {
border-bottom: 5px solid #999;
}
Or try: 或尝试:
.best-sellers h4 {border-bottom: 5px solid #999;}
Try: 尝试:
.wpb_wrapper h4 { border-bottom: 1px solid #eeeeee;}
Or try adding a class to h4 eg 或者尝试将类添加到h4中,例如
<h4 class="borderh4">Lol</h4>
.borderh4 {border-bottom: 1px solid #eeeeee;}
Best to select based on it's parent div class: 最好根据其父div类进行选择:
.wpb_wrapper h4 {
border-bottom: 1px solid #eee;
padding: 7px 0px;
}
As the previous answer stated, if your parent div has multiple classes, you usually need to select both for it to grab the right element: 如前一个答案所述,如果您的父div有多个类,则通常需要同时选择它们以获取正确的元素:
.wpb_wrapper.another_class h4 {}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.