Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Participant ,
Nov 27, 2025 Nov 27, 2025

 

 

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...

TOPICS
Code
63
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 01, 2025 Dec 01, 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.

Translate
Community Expert ,
Dec 01, 2025 Dec 01, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 04, 2025 Dec 04, 2025
LATEST

many thanks Jon, it works!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines