Site icon PlusMagi's Blog By Pitt Phunsanit

ให้ฟุตเตอร์อยู่ด้านล่างพอดีหน้าจอ (ตาราง)

จากที่เคยเขียน ให้ฟุตเตอร์อยู่ด้านล่างพอดีหน้าจอ
ถ้าหน้าเว็บสั้นกว่าจอโดยใช้ tableless เรามาย้อนยุคโดยใช้ตารางดูบ้าง
note

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>100% table height</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css3.css">
<style>
html
{
 height:100%;
}
body
{
 height:100%;
 margin: 0px;
 padding: 0px;
 font-family: Helvetica, Arial, "Trebuchet MS", sans-serif;
}
table
{
 border: 0 none;
 height:100%;
}
td
{
 margin: 0px;
 padding: 0px;
 vertical-align:top;
 height:0px;
}
#header
{
 background:#c00000;
 height:20px;
}
#footer
{
 background:#c00000;
 height:20px;
}
</style>
</head>
<body>
<table border="1" class="tablewrapper">
 <tr>
 <td id="header">header</td>
 </tr>
 <tr>
 <td>contents</td>
 </tr>
 <tr>
 <td id="footer">footer</td>
 </tr>
</table>
</body>
</html>

อ่านเพิ่มเติม

Exit mobile version