tags:

views:

21

answers:

3

Div height is not support in below code

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<style type="text/css">
.Footer{
background-color:red;
width:673px;
height:1px;
}
</style>

<title>Fist</title>
</head>

<body>
<div class="Footer"></div>
</body>
</body>

</html>

But its work below code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"&gt;

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<style type="text/css">
.Footer{
background-color:red;
width:673px;
height:1px;
}
</style>

<title>Second</title>
</head>

<body>
                        <div class="Footer"></div>
</body>
</body>

</html>

How to set div height in 1st coding

A: 

In first piece of code you have:

div class="Footer"></div>

which should be:

<div class="Footer"></div>

You also do not have a doctype set for your first example. I would suggest adding something like:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; 
simnom
is it possible to do with out <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
if i use <!DOCTYPE > in my web page the letters are coming like stretched in internet explore 9
The bare minimum you should use is <!DOCTYPE html> which is the doctype declaration for HTML5 documents and is the bare minimum for IE to run in standards mode and should also be backwards compatible.
simnom
+2  A: 

why are you using 2 body tags?????????????? add < befor div tag

Sheetal Inani
A: 
<body>
div class="Footer"></div>
</body>

You can add < before div tag

ismailperim