首页 > 开发 > CSS > 正文

利用CSS使footer固定在页面底部的实例代码

2024-07-11 08:33:00
字体:
来源:转载
供稿:网友

1. HTML基本结构

XML/HTML Code复制内容到剪贴板
  1. <!DOCTYPEhtml>     
  2. <htmlxmlnshtmlxmlns="http://www.w3.org/1999/xhtml">     
  3. <headrunatheadrunat="server">     
  4.     <title>layout</title>     
  5. </head>     
  6. <body>     
  7.     <divclassdivclass="header">     
  8.         <h1>head of your website.</h1>     
  9.     </div>     
  10.     <divclassdivclass="wrapper">     
  11.         <divclassdivclass="content">     
  12.             <h2>Your website content here.</h2>     
  13.             <scripttypescripttype="text/javascript">     
  14.                 for(var i = 0; i<100;i++){      
  15.                     document.write(i + "<br />");      
  16.                 }      
  17.             </script>     
  18.         </div>     
  19.         <divclassdivclass="clear"><!-- 必不可少 --></div>     
  20.     </div>     
  21.     <divclassdivclass="footer">     
  22.         <div><h1>     
  23.             Copyright (c) 2012</h1></div>     
  24.     </div>     
  25. </body>     
  26. </html>     
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表