Skip to main content
higgsyd
Inspiring
November 27, 2025
Answered

my media query is being over-ridden by a rule in the body

  • November 27, 2025
  • 1 reply
  • 145 views

 

 

Trying to change font: 100% to font:150%  The 150% is declared in the actual page as an internal style within a media query.  So why does the rule in the body supersede the internal style?

 

https://higgsy.com/newroot/france/france.html 

 

If I open developer tools and then reduce the size of the browser down to iphone size then my media style appears in the developer tools – I then, in Devolper Tools, untick the superseding rule in the body statement, (turning it off temporarily) then my font statement in my media query can be seen to become active and the we can see the font change in the browser

 

Also I note ALL the rules in that media query are greyed out

 

all comments appreciated...

Correct answer Jon Fritz

Your external stylesheets come after your internal <style> tagset. CSS cascades from first loaded to last loaded, if you have identical selectors in both, whatever is written to the page last will take over.

You should be able to put your css links into your <head> section, before your <style> tagset, to get them to load the way you want.

1 reply

Jon Fritz
Community Expert
Jon FritzCommunity ExpertCorrect answer
Community Expert
December 1, 2025

Your external stylesheets come after your internal <style> tagset. CSS cascades from first loaded to last loaded, if you have identical selectors in both, whatever is written to the page last will take over.

You should be able to put your css links into your <head> section, before your <style> tagset, to get them to load the way you want.

higgsyd
higgsydAuthor
Inspiring
December 4, 2025

many thanks Jon, it works!