Everything, Everything

2024: J F M A M J J A S O N
2023: J F M A M J J A S O N D
2022: J F M A M J J A S O N D
2021: J F M A M J J A S O N D
2020: J F M A M J J A S O N D
2019: J F M A M J J A S O N D
2018: J F M A M J J A S O N D
2017: J F M A M J J A S O N D
2016: J F M A M J J A S O N D
2015: J F M A M J J A S O N D
2014: J F M A M J J A S O N D
2013: J F M A M J J A S O N D
2012: J F M A M J J A S O N D
2011: J F M A M J J A S O N D
2010: J F M A M J J A S O N D
2009: J F M A M J J A S O N D
2008: J F M A M J J A S O N D
2007: J F M A M J J A S O N D
2006: J F M A M J J A S O N D
2005: J F M A M J J A S O N D
2004: J F M A M J J A S O N D
What A Difference A Space Makes
Sunday 2nd July, 2017 17:58 Comments: 0
I had a line of code in a website I'm working on in my spare time:

<meta name="viewport" content="width=device-width, initial-scale=1">

This line tells the browser how to deal with content on different sized devices. The line above is essentially identical to the example given by W3 Schools.

This works perfectly in IE, and in Chrome Dev on Android. I then tried it on Chrome 59 on the desktop and none of the media queries were working as expected. I did a quick Google search and found someone's advice to include the meta tag. I looked closer and spotted they hadn't included a space between the width and initial-scale parameters. I removed the space and reloaded the page. Chrome on the desktop was happy. The other browsers remain happy too.

It's bad enough having to mess about with things like box-sizing in CSS, but quirks like a single space causing the viewport to fail spectacularly in Chrome is quite annoying.

At least the new site looks pretty good at various sizes thanks to its responsive web design.
© Robert Nicholls 2002-2024
The views and opinions expressed on this site do not represent the views of my employer.
HTML5 / CSS3