Dave's Brain

Browse - Programming Tips - Why is my [DOCTYPE html] page not working?

Date: 2017feb20
Platform: web
Keywords: html5

Q.  Why is my [DOCTYPE html] page not working?

A.  The most common reason is missing 'px'.
Older html/css assumed pixels when the unit was missing.

<style> .something { width: 100; } /* wrong */ </style>
<style> .something { width: 100px; } /* right */ </style>
Same with javaScript.
<script> node.style.left = 100; // wrong </script>
<script> node.style.left = '100px'; // right </script>
Another issue is 100% height pages not being full height. http://www.tutwow.com/htmlcss/quick-tip-css-100-height/

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.