如何保持页脚和内容之间的差距?(how to keep a margin between the footer and the content?)

编程入门 行业动态 更新时间:2024-10-28 16:30:47
如何保持页脚和内容之间的差距?(how to keep a margin between the footer and the content?)

你好我试图建立一个页脚底部的集中式网站,问题是页脚div和内容div之间没有边距,页脚与内容重叠但是当我缩小页面问题是固定的但是另一个问题来了哪个内容高度不够这里是链接网站上传所以你可以看到问题

http://yandothebluffer66.net23.net/

这是代码

<!DOCTYPE html> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <title>Untitled 1</title> <style type="text/css"> html, body { margin:0; padding:0; height:100%; } #wrapper { min-height:100%; position:relative; } #header { background:#292929; height : 100px; } #content { padding-bottom:100px; /* Height of the footer element */ width: 1000px; margin : 50px auto; min-height: 80%;; background: black; overflow: hidden; } #footer { background:#292929; width:100%; height:100px; position:absolute; bottom:0; left:0; } </style> </head> <body> <div id="bigwrapper"> <div id="header"></div> <div id="content"> <img src="images/stuff%20for%20sale/9.jpg"> </div> &t;div id="footer"></div> </div> </body> </html>

hello am trying to make a centralized website with the footer at the bottom and the problem is there is no margins between the footer div and the content div the footer is overlapping the content but when I zoom out the page the problem is fixed however another problem came which is the content height is not full here is a link with the website uploaded so you can see the problem

http://yandothebluffer66.net23.net/

and here is the code

<!DOCTYPE html> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <title>Untitled 1</title> <style type="text/css"> html, body { margin:0; padding:0; height:100%; } #wrapper { min-height:100%; position:relative; } #header { background:#292929; height : 100px; } #content { padding-bottom:100px; /* Height of the footer element */ width: 1000px; margin : 50px auto; min-height: 80%;; background: black; overflow: hidden; } #footer { background:#292929; width:100%; height:100px; position:absolute; bottom:0; left:0; } </style> </head> <body> <div id="bigwrapper"> <div id="header"></div> <div id="content"> <img src="images/stuff%20for%20sale/9.jpg"> </div> <div id="footer"></div> </div> </body> </html>

最满意答案

    <!DOCTYPE html>
    <html>
    
    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <title>Untitled 1</title>
    
    <style type="text/css">
    html,
    body {
    margin:0;
    padding:0;
    height:100%;
    }
    #bigwrapper{height:100%;}
    #wrapper {
    min-height:100%;
    position:relative;
    }
    #header {
    background:#292929;
    height : 100px;
    min-height:8%;
    }
    #content {
    width: 80%;
    margin : 50px auto;
    background: black;
    overflow: hidden;
    }
    #footer {
    background:#292929;
    width:100%;
    height:100px;
    min-height:8%;
    position:inherit;
    bottom:0;
    left:0;
    
    }
    
    
    </style>
    </head>
    
    <body>
    <div id="bigwrapper">
        <div id="header"></div>
        <div id="content">
            <img src="http://yandothebluffer66.net23.net/images/stuff%20for%20sale/9.jpg" width="100%">
        </div>
        <div id="footer"></div>
    </div>
    </body>
    
     </html>   
  
 

    <!DOCTYPE html>
    <html>
    
    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <title>Untitled 1</title>
    
    <style type="text/css">
    html,
    body {
    margin:0;
    padding:0;
    height:100%;
    }
    #bigwrapper{height:100%;}
    #wrapper {
    min-height:100%;
    position:relative;
    }
    #header {
    background:#292929;
    height : 100px;
    min-height:8%;
    }
    #content {
    width: 80%;
    margin : 50px auto;
    background: black;
    overflow: hidden;
    }
    #footer {
    background:#292929;
    width:100%;
    height:100px;
    min-height:8%;
    position:inherit;
    bottom:0;
    left:0;
    
    }
    
    
    </style>
    </head>
    
    <body>
    <div id="bigwrapper">
        <div id="header"></div>
        <div id="content">
            <img src="http://yandothebluffer66.net23.net/images/stuff%20for%20sale/9.jpg" width="100%">
        </div>
        <div id="footer"></div>
    </div>
    </body>
    
     </html>   
  
 

更多推荐

本文发布于:2023-08-03 02:14:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1382925.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:差距   内容   margin   footer   content

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!