2010-10-14 62 views
0

事业部高度不支持在下面的代码股利高度不支持

<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> 

但下面的代码工作

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

<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> 

如何设置在第一个DIV高度编码

+0

2日收盘头和2闭塞体... ...有趣的是 – Shikiryu 2010-10-14 08:04:08

回答

0

在第一块代码你有:

div class="Footer"></div> 

它应该是:

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

您还没有为第一个示例设置doctype。我建议添加类似:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
+0

有可能与做出来的< !DOCTYPE html PUBLIC“ - // W3C // DTD XHTML 1.0 Transitional // EN”“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> – user475464 2010-10-14 08:08:01

+0

如果我在我的网站中使用网页上的字母就像在网上探索一样9 – user475464 2010-10-14 08:09:31

+0

最低限度你应该使用我s <!DOCTYPE html>,它是HTML5文档的doctype声明,是IE在标准模式下运行的最低限度,也应该向后兼容。 – simnom 2010-10-14 08:24:11

2

你为什么要使用2个body标签?????????????? 添加< befor div标签

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

你可以div标签前添加<