Dave's Brain

Browse - programming tips - why doesnt absolute position work with doctype

Date: 2008aug6

Q.  Why doesn't a CSS absolute position work when my page has a DOCTYPE?

A.  The DOCTYPE makes it more strict.  You probably just need to add "px"
on your coordinates.

For example...

Does NOT work with DOCTYPE:

	<div style="position:absolute; left:10; top:10;">Hello</div>

Does work with DOCTYPE:

	<div style="position:absolute; left:10px; top:10px;">Hello</div>
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, 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.
Advertisements: