Comment: New elements header and footer have been added to html 5. After testing, IE found that IE cannot parse new elements added to html 5. The code is as follows: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN ><html xmlns=
New elements header and footer were added to html 5. After testing, IE found that IE cannot parse new elements added to html 5.
The code is as follows: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN >
<html xmlns=>
<head>
<meta http-equiv=Content-Type content=text/html; charset=gb2312 />
<title>Unt titled document</title>
<style type=text/css>
<!--
*{
margin:0;
padding:0;
}
header{
background:#090;
font-weight:bold;
position:absolute;
top:10px;
}
footer{
background:#f90;
font-weight:bold;
position:absolute;
bottom:10px;
}
-->
</style>
</head>
<body>
<header>Here is the top</header>
<footer>This is the tail</footer>
</div>
</body>
</html>
Use custom tags to solve the problem of browser compatibility
The code is as follows:
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN >
<html xmlns:layout>
<head>
<meta http-equiv=Content-Type content=text/html; charset=gb2312 />
<title>Custom html tags</title>
<style type=text/css>
<!--
*{
margin:0;
padding:0;
}
layout/:header{
background:#090;
font-weight:bold;
position:absolute;
top:10px;
}
layout/:footer{
background:#f90;
font-weight:bold;
position:absolute;
bottom:10px;
}
-->
</style>
</head>
<body>
<layout:header>Here is the top</layout:header>
<layout:footer>This is the tail</layout:footer>
</body>
</html>