最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

css - Why doesn't media(max-width) work on h2 title?

programmeradmin0浏览0评论

I am trying to style posts on my website, but when I try to change font size with media function in CSS I can't seem to change font size for h2. When I go to "inspect element" and navigate to "style" section I see that my styling for fon-size is crossed. What does that mean?

I am trying to style posts on my website, but when I try to change font size with media function in CSS I can't seem to change font size for h2. When I go to "inspect element" and navigate to "style" section I see that my styling for fon-size is crossed. What does that mean?

Share Improve this question edited May 19, 2019 at 15:11 fuxia 107k39 gold badges255 silver badges459 bronze badges asked May 19, 2019 at 14:58 ToTheSpace 2ToTheSpace 2 1011 bronze badge 1
  • 1 The order of media queries is important, take a closer look into this. This question will be deemed off topic, as it is not WordPress specific. Please take a close look at the help center to learn about the sites guidelines. – Nicolai Grossherr Commented May 19, 2019 at 15:30
Add a comment  | 

1 Answer 1

Reset to default -1

It's being overwritten by the line at the top. You can see from the bit on the end of the filename that the your media query CSS is on line 133, but the CSS that's overwriting it is on line 182. Because they use the same selector (.posts h2) the last one will take precedence, according to the rules of specificity. You either need to remove the line on 182, or move your new CSS below it.

发布评论

评论列表(0)

  1. 暂无评论