Jump to content

Simple CSS media query not working in Firefox 12


cyberRobot

Recommended Posts

Anyone know why the following media query doesn't work in Firefox 12?

 

<html>
<head>
<style type="text/css">
p { display:none; }
@media (max-width: 460px) {
p { display:block; }
}
</style>
</head>

<body><p>here</p></body>
</html>

 

 

Note that it works as expected in Chrome and Internet Explorer. Also, the media query example by A List Apart (http://www.alistapart.com/d/responsive-web-design/ex/ex-site-FINAL.html) works in Firefox...  :shrug:

Well, apparently this may be a problem with the install of Firefox I was using last night. The code works in Firefox 11 and 12 on two other computers. However, the code doesn't seem to work in Internet Explorer 9 on either of these computers--it was working last night though. :confused:

You've likely got syntax errors.  Check for any missing ;

 

You may be on to something. After adding the proper DOCTYPE, title, etc. to get the HTML to validate, the code works in IE9 now.

 

I'll have to check the real code later.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.