首页 > 开发 > CSS > 正文

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

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

1. HTML基本结构

XML/HTML Code复制内容到剪贴板

<!DOCTYPEhtml>  
  
<htmlxmlnshtmlxmlns="http://www.w3.org/1999/xhtml">  
  
<headrunatheadrunat="server">  
  
    <title>layout</title>  
  
</head>  
  
<body>  
  
    <divclassdivclass="header">  
  
        <h1>head of your website.</h1>  
  
    </div>  
  
    <divclassdivclass="wrapper">  
  
        <divclassdivclass="content">  
  
            <h2>Your website content here.</h2>  
  
            <scripttypescripttype="text/javascript">  
  
                for(var i = 0; i<100;i++){   
  
                    document.write(i + "<br />");   
  
                }   
  
            </script>  
  
        </div>  
  
        <divclassdivclass="clear"><!– 必不可少 –></div>  
  
    </div>  
  
    <divclassdivclass="footer">  
  
        <div><h1>  
  
            Copyright (c) 2012</h1></div>  
  
    </div>  
  
</body>  
  
</html>  
  

2. CSS样式

CSS Code复制内容到剪贴板

<styletype="text/css">   

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表