栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > Html/CSS > CSS教程

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

CSS教程 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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

1. HTML基本结构

XML/HTML Code复制内容到剪贴板
  1.   
  2.   
  3.   
  4.   
  5.   
  6.   
  7.     layout  
  8.   
  9.   
  10.   
  11.   
  12.   
  13.       
  14.   
  15.         

    head of your website.

      
  16.   
  17.     
  
  •   
  •       
  •   
  •           
  •   
  •             

    Your website content here.

      
  •   
  •               
  •   
  •                 for(var i = 0; i<100;i++){   
  •   
  •                     document.write(i + "");   
  •   
  •                 }   
  •   
  •               
  •   
  •         
  •   
  •   
  •         
  •   
  •   
  •     
  •   
  •   
  •       
  •   
  •         

      

  •   
  •             Copyright (c) 2012  
  •   
  •       
  •   
  •   
  •   
  •   
  •   
  • 2. CSS样式

    CSS Code复制内容到剪贴板
    1.   
    2.   
    3.         *{   
    4.   
    5.             margin: 0;  
    6.   
    7.         }   
    8.   
    9.         html, body   
    10.   
    11.         {   
    12.   
    13.             height: 100%;   
    14.   
    15.             width:85%;   
    16.   
    17.             margin:0auto;  
    18.   
    19.         }   
    20.   
    21.            
    22.   
    23.         .header   
    24.   
    25.         {   
    26.   
    27.             height:100px;   
    28.   
    29.             background-color:Fuchsia;   
    30.   
    31.         }   
    32.   
    33.            
    34.   
    35.         .wrapper   
    36.   
    37.         {   
    38.   
    39.             min-height: 100%;  
    40.   
    41.             height: auto!important;  
    42.   
    43.             height: 100%;   
    44.   
    45.             margin: 0auto-4em;  
    46.   
    47.         }   
    48.   
    49.            
    50.   
    51.         .content  
    52.   
    53.         {   
    54.   
    55.             background-color:Silver;   
    56.   
    57.         }   
    58.   
    59.            
    60.   
    61.         .clear  
    62.   
    63.         {   
    64.   
    65.             height: 4em;   
    66.   
    67.             clear:both;   
    68.   
    69.         }   
    70.   
    71.            
    72.   
    73.         .footer   
    74.   
    75.         {   
    76.   
    77.             height: 4em;   
    78.   
    79.             background-color:Aqua;   
    80.   
    81.         }   
    82.   
    83.        

    以上这篇利用CSS使footer固定在页面底部的实例代码就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持考高分网。

    转载请注明:文章转载自 www.mshxw.com
    本文地址:https://www.mshxw.com/it/215924.html

    CSS教程相关栏目本月热门文章

    我们一直用心在做
    关于我们 文章归档 网站地图 联系我们

    版权所有 (c)2021-2022 MSHXW.COM

    ICP备案号:晋ICP备2021003244-6号