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?enter image description here

  • 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 May 19 at 15:30

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.

  • I think, this should be a comment, and not an answer to a clearly off topic question. Just so you're clear about the down vote. Nothing personal. – Nicolai May 19 at 15:33
  • Considering that the answer is correct, you're just being ridiculously petty. – Jacob Peattie May 19 at 15:44
  • It is encouraging off topic questions. In my humble opinion we shouldn't do that. Besides, you could have given the necessary information in a comment. Just letting you know my reasoning. We can disagree on the assessment if it is reasonable. – Nicolai May 19 at 15:47
  • Regardless of your answer being more like comment or answer, thank you for helping. My code is a little bit messy and I am not experienced in coding hence this mistake. I looked a bit through my code and found instances that were causing problems. I resolved it. Thank you for your help! – ToTheSpace 2 May 19 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.