admin管理员组

文章数量:1426620

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.

本文标签: cssWhy doesn39t media(maxwidth) work on h2 title