Jump to content

Height With Css


jarrett000

Recommended Posts

I have an image I want at 30%, but the doctype (strict) is preventing from. Here's my code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html xmlns='http://www.w3.org/1999/xhtml' lang='en_US' xml:lang='en_US'><head><style type="text/css">.MainIimg {height: 30%;}</style></head><body><img src="NavImg.gif" class="MainIimg" /></body>

I've also tried setting it with height="30%" but it just doesn't do anything. This does work, however, when I donot have a doctype present. Is there a way to bypass the doctype?

Link to comment
Share on other sites

Add this to your CSS:

html,body { height: 100% };

Also, you need to add it to every element that's an ancestor of the node you want to resize.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...