hi,
I want to make a "div" that width is 200px and height is 100px as following:
==============
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>hello</title>
</head>
<body>
<div style="width:200;heigth:100;background:silver;">
hello everyone!
</div>
</body>
</html>
==============
however,it displays as:width is 100% and height is as height as a word . But if I delete the DOCTYPE,it works as i expected above.
so,how can i achieve the effect if i don't delete the DOCTYPE?
thanks.
By doing it right. Browsers are a little more lenient when in Quirks Mode. Almost all CSS properties that take a numeric value require a unit when the value is other than zero.
http://www.w3.org/TR/CSS2/syndata.html#value-def-length
About Quirks and Standards Mode...
http://hsivonen.iki.fi/doctype/
You are welcome.
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)