Resolve overlapping elements in HTML





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















My HTML page has a header, navigation bar, body content element and a footer element however the footer element is overlapping with the div element bodycontent when it should be below the bodycontent element and at the bottom of the page. Please suggest any changes in positioning to resolve this.



.header {
padding: 10px;
width: 100%;

text-align: center;
background-color: #F2F2F2;
color: #424242;
}
body {
margin: 0px;
padding: 0px;
height: 100%;
font: 300 100% 'Helvetica Neue', Helvetica, Arial;
}
.footer {
clear: both;
position: inherit;
bottom: 0;
left: 0;
text-align: center;
width: 100%;
height: 20px;
background-color: #808080;
color:#fff;
}
.prodheading {
width: 100%;
height: 20px;
background-color: #808080;
color: #fff;
text-align: center;
vertical-align: middle;
}

ul.nav_bar{
position: absolute;
height: 50px;
top: 50%; left: 50%;
margin-top: -25px; margin-left: -200px;
padding: 0px;

list-style: none;
text-align: center;

}
.bodycontent{
position:relative;
top:45px;
bottom:30px
padding:15px;
}


My home HTML page -



<html>
<head>
<style><%@include file="/css/mystyle.css"%></style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>My Webpage</title>
</head>
<body>
<%@ include file="header.jsp" %>
<div class="bodycontent">
<h3>Our Mission</h3>
<p>Hello World !!!</p>
<h3></h3>
<p>Trying out webpage</p>
</div>
<%@ include file="footer.jsp" %>
</body>
</html>


The header html element -



<html>

<head>
<style><%@include file="/css/mystyle.css"%></style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<center>
<h3>Title 1</h3>
<h5>Title 2</h5>

</center>


<ul class="nav_bar">
<li class="navit"><a class="link">Home</a></li>
<li class="navit"><a class="link" >Items</a></li>
<li class="navit"><a class="link" >About Us</a></li>
<li class="navit"><a class="link" >Contact</a></li>

</ul>
</body>
</html>


The footer html element



<html>
<head>
<style><%@include file="/css/mystyle.css"%></style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<center>All rights reserved 2018</center>
</body>
</html>









share|improve this question

























  • Hey dfvc! Thanks for contributing to SO! Could you please post any relevant HTML for this question as well? It's hard to troubleshoot code when we can't see a "final" product of any kind! Thanks in advanced

    – Ryan
    Nov 16 '18 at 19:47











  • @Ryan Hi, I have updated the HTML elements.

    – dfvc
    Nov 16 '18 at 19:55


















0















My HTML page has a header, navigation bar, body content element and a footer element however the footer element is overlapping with the div element bodycontent when it should be below the bodycontent element and at the bottom of the page. Please suggest any changes in positioning to resolve this.



.header {
padding: 10px;
width: 100%;

text-align: center;
background-color: #F2F2F2;
color: #424242;
}
body {
margin: 0px;
padding: 0px;
height: 100%;
font: 300 100% 'Helvetica Neue', Helvetica, Arial;
}
.footer {
clear: both;
position: inherit;
bottom: 0;
left: 0;
text-align: center;
width: 100%;
height: 20px;
background-color: #808080;
color:#fff;
}
.prodheading {
width: 100%;
height: 20px;
background-color: #808080;
color: #fff;
text-align: center;
vertical-align: middle;
}

ul.nav_bar{
position: absolute;
height: 50px;
top: 50%; left: 50%;
margin-top: -25px; margin-left: -200px;
padding: 0px;

list-style: none;
text-align: center;

}
.bodycontent{
position:relative;
top:45px;
bottom:30px
padding:15px;
}


My home HTML page -



<html>
<head>
<style><%@include file="/css/mystyle.css"%></style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>My Webpage</title>
</head>
<body>
<%@ include file="header.jsp" %>
<div class="bodycontent">
<h3>Our Mission</h3>
<p>Hello World !!!</p>
<h3></h3>
<p>Trying out webpage</p>
</div>
<%@ include file="footer.jsp" %>
</body>
</html>


The header html element -



<html>

<head>
<style><%@include file="/css/mystyle.css"%></style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<center>
<h3>Title 1</h3>
<h5>Title 2</h5>

</center>


<ul class="nav_bar">
<li class="navit"><a class="link">Home</a></li>
<li class="navit"><a class="link" >Items</a></li>
<li class="navit"><a class="link" >About Us</a></li>
<li class="navit"><a class="link" >Contact</a></li>

</ul>
</body>
</html>


The footer html element



<html>
<head>
<style><%@include file="/css/mystyle.css"%></style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<center>All rights reserved 2018</center>
</body>
</html>









share|improve this question

























  • Hey dfvc! Thanks for contributing to SO! Could you please post any relevant HTML for this question as well? It's hard to troubleshoot code when we can't see a "final" product of any kind! Thanks in advanced

    – Ryan
    Nov 16 '18 at 19:47











  • @Ryan Hi, I have updated the HTML elements.

    – dfvc
    Nov 16 '18 at 19:55














0












0








0








My HTML page has a header, navigation bar, body content element and a footer element however the footer element is overlapping with the div element bodycontent when it should be below the bodycontent element and at the bottom of the page. Please suggest any changes in positioning to resolve this.



.header {
padding: 10px;
width: 100%;

text-align: center;
background-color: #F2F2F2;
color: #424242;
}
body {
margin: 0px;
padding: 0px;
height: 100%;
font: 300 100% 'Helvetica Neue', Helvetica, Arial;
}
.footer {
clear: both;
position: inherit;
bottom: 0;
left: 0;
text-align: center;
width: 100%;
height: 20px;
background-color: #808080;
color:#fff;
}
.prodheading {
width: 100%;
height: 20px;
background-color: #808080;
color: #fff;
text-align: center;
vertical-align: middle;
}

ul.nav_bar{
position: absolute;
height: 50px;
top: 50%; left: 50%;
margin-top: -25px; margin-left: -200px;
padding: 0px;

list-style: none;
text-align: center;

}
.bodycontent{
position:relative;
top:45px;
bottom:30px
padding:15px;
}


My home HTML page -



<html>
<head>
<style><%@include file="/css/mystyle.css"%></style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>My Webpage</title>
</head>
<body>
<%@ include file="header.jsp" %>
<div class="bodycontent">
<h3>Our Mission</h3>
<p>Hello World !!!</p>
<h3></h3>
<p>Trying out webpage</p>
</div>
<%@ include file="footer.jsp" %>
</body>
</html>


The header html element -



<html>

<head>
<style><%@include file="/css/mystyle.css"%></style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<center>
<h3>Title 1</h3>
<h5>Title 2</h5>

</center>


<ul class="nav_bar">
<li class="navit"><a class="link">Home</a></li>
<li class="navit"><a class="link" >Items</a></li>
<li class="navit"><a class="link" >About Us</a></li>
<li class="navit"><a class="link" >Contact</a></li>

</ul>
</body>
</html>


The footer html element



<html>
<head>
<style><%@include file="/css/mystyle.css"%></style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<center>All rights reserved 2018</center>
</body>
</html>









share|improve this question
















My HTML page has a header, navigation bar, body content element and a footer element however the footer element is overlapping with the div element bodycontent when it should be below the bodycontent element and at the bottom of the page. Please suggest any changes in positioning to resolve this.



.header {
padding: 10px;
width: 100%;

text-align: center;
background-color: #F2F2F2;
color: #424242;
}
body {
margin: 0px;
padding: 0px;
height: 100%;
font: 300 100% 'Helvetica Neue', Helvetica, Arial;
}
.footer {
clear: both;
position: inherit;
bottom: 0;
left: 0;
text-align: center;
width: 100%;
height: 20px;
background-color: #808080;
color:#fff;
}
.prodheading {
width: 100%;
height: 20px;
background-color: #808080;
color: #fff;
text-align: center;
vertical-align: middle;
}

ul.nav_bar{
position: absolute;
height: 50px;
top: 50%; left: 50%;
margin-top: -25px; margin-left: -200px;
padding: 0px;

list-style: none;
text-align: center;

}
.bodycontent{
position:relative;
top:45px;
bottom:30px
padding:15px;
}


My home HTML page -



<html>
<head>
<style><%@include file="/css/mystyle.css"%></style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>My Webpage</title>
</head>
<body>
<%@ include file="header.jsp" %>
<div class="bodycontent">
<h3>Our Mission</h3>
<p>Hello World !!!</p>
<h3></h3>
<p>Trying out webpage</p>
</div>
<%@ include file="footer.jsp" %>
</body>
</html>


The header html element -



<html>

<head>
<style><%@include file="/css/mystyle.css"%></style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<center>
<h3>Title 1</h3>
<h5>Title 2</h5>

</center>


<ul class="nav_bar">
<li class="navit"><a class="link">Home</a></li>
<li class="navit"><a class="link" >Items</a></li>
<li class="navit"><a class="link" >About Us</a></li>
<li class="navit"><a class="link" >Contact</a></li>

</ul>
</body>
</html>


The footer html element



<html>
<head>
<style><%@include file="/css/mystyle.css"%></style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<center>All rights reserved 2018</center>
</body>
</html>






html css






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 19:54







dfvc

















asked Nov 16 '18 at 19:46









dfvcdfvc

33




33













  • Hey dfvc! Thanks for contributing to SO! Could you please post any relevant HTML for this question as well? It's hard to troubleshoot code when we can't see a "final" product of any kind! Thanks in advanced

    – Ryan
    Nov 16 '18 at 19:47











  • @Ryan Hi, I have updated the HTML elements.

    – dfvc
    Nov 16 '18 at 19:55



















  • Hey dfvc! Thanks for contributing to SO! Could you please post any relevant HTML for this question as well? It's hard to troubleshoot code when we can't see a "final" product of any kind! Thanks in advanced

    – Ryan
    Nov 16 '18 at 19:47











  • @Ryan Hi, I have updated the HTML elements.

    – dfvc
    Nov 16 '18 at 19:55

















Hey dfvc! Thanks for contributing to SO! Could you please post any relevant HTML for this question as well? It's hard to troubleshoot code when we can't see a "final" product of any kind! Thanks in advanced

– Ryan
Nov 16 '18 at 19:47





Hey dfvc! Thanks for contributing to SO! Could you please post any relevant HTML for this question as well? It's hard to troubleshoot code when we can't see a "final" product of any kind! Thanks in advanced

– Ryan
Nov 16 '18 at 19:47













@Ryan Hi, I have updated the HTML elements.

– dfvc
Nov 16 '18 at 19:55





@Ryan Hi, I have updated the HTML elements.

– dfvc
Nov 16 '18 at 19:55












1 Answer
1






active

oldest

votes


















0














You need to add CSS code like this:






.header {
display: inline-block;
padding: 10px;
width: 100%;
text-align: center;
background-color: #F2F2F2;
color: #424242;
}
body {
margin: 0px;
padding: 0px;
height: 100%;
font: 300 100% 'Helvetica Neue', Helvetica, Arial;
}
.footer {
display: inline-block;
width: 100%;;
text-align: center;
width: 100%;
height: 20px;
background-color: #808080;
color:#fff;
}
.prodheading {
display: inline-block;
width: 100%;
height: 20px;
background-color: #808080;
color: #fff;
text-align: center;
vertical-align: middle;
}

ul.nav_bar{
position: absolute;
height: 50px;
top: 50%; left: 50%;
margin-top: -25px; margin-left: -200px;
padding: 0px;
list-style: none;
text-align: center;

}
.bodycontent{
display: inline-block;
width: 100%;
padding:15px;
}





Now, You can add CSS for main menu design in ul.nav_bar as per your requirements.






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53344404%2fresolve-overlapping-elements-in-html%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You need to add CSS code like this:






    .header {
    display: inline-block;
    padding: 10px;
    width: 100%;
    text-align: center;
    background-color: #F2F2F2;
    color: #424242;
    }
    body {
    margin: 0px;
    padding: 0px;
    height: 100%;
    font: 300 100% 'Helvetica Neue', Helvetica, Arial;
    }
    .footer {
    display: inline-block;
    width: 100%;;
    text-align: center;
    width: 100%;
    height: 20px;
    background-color: #808080;
    color:#fff;
    }
    .prodheading {
    display: inline-block;
    width: 100%;
    height: 20px;
    background-color: #808080;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    }

    ul.nav_bar{
    position: absolute;
    height: 50px;
    top: 50%; left: 50%;
    margin-top: -25px; margin-left: -200px;
    padding: 0px;
    list-style: none;
    text-align: center;

    }
    .bodycontent{
    display: inline-block;
    width: 100%;
    padding:15px;
    }





    Now, You can add CSS for main menu design in ul.nav_bar as per your requirements.






    share|improve this answer




























      0














      You need to add CSS code like this:






      .header {
      display: inline-block;
      padding: 10px;
      width: 100%;
      text-align: center;
      background-color: #F2F2F2;
      color: #424242;
      }
      body {
      margin: 0px;
      padding: 0px;
      height: 100%;
      font: 300 100% 'Helvetica Neue', Helvetica, Arial;
      }
      .footer {
      display: inline-block;
      width: 100%;;
      text-align: center;
      width: 100%;
      height: 20px;
      background-color: #808080;
      color:#fff;
      }
      .prodheading {
      display: inline-block;
      width: 100%;
      height: 20px;
      background-color: #808080;
      color: #fff;
      text-align: center;
      vertical-align: middle;
      }

      ul.nav_bar{
      position: absolute;
      height: 50px;
      top: 50%; left: 50%;
      margin-top: -25px; margin-left: -200px;
      padding: 0px;
      list-style: none;
      text-align: center;

      }
      .bodycontent{
      display: inline-block;
      width: 100%;
      padding:15px;
      }





      Now, You can add CSS for main menu design in ul.nav_bar as per your requirements.






      share|improve this answer


























        0












        0








        0







        You need to add CSS code like this:






        .header {
        display: inline-block;
        padding: 10px;
        width: 100%;
        text-align: center;
        background-color: #F2F2F2;
        color: #424242;
        }
        body {
        margin: 0px;
        padding: 0px;
        height: 100%;
        font: 300 100% 'Helvetica Neue', Helvetica, Arial;
        }
        .footer {
        display: inline-block;
        width: 100%;;
        text-align: center;
        width: 100%;
        height: 20px;
        background-color: #808080;
        color:#fff;
        }
        .prodheading {
        display: inline-block;
        width: 100%;
        height: 20px;
        background-color: #808080;
        color: #fff;
        text-align: center;
        vertical-align: middle;
        }

        ul.nav_bar{
        position: absolute;
        height: 50px;
        top: 50%; left: 50%;
        margin-top: -25px; margin-left: -200px;
        padding: 0px;
        list-style: none;
        text-align: center;

        }
        .bodycontent{
        display: inline-block;
        width: 100%;
        padding:15px;
        }





        Now, You can add CSS for main menu design in ul.nav_bar as per your requirements.






        share|improve this answer













        You need to add CSS code like this:






        .header {
        display: inline-block;
        padding: 10px;
        width: 100%;
        text-align: center;
        background-color: #F2F2F2;
        color: #424242;
        }
        body {
        margin: 0px;
        padding: 0px;
        height: 100%;
        font: 300 100% 'Helvetica Neue', Helvetica, Arial;
        }
        .footer {
        display: inline-block;
        width: 100%;;
        text-align: center;
        width: 100%;
        height: 20px;
        background-color: #808080;
        color:#fff;
        }
        .prodheading {
        display: inline-block;
        width: 100%;
        height: 20px;
        background-color: #808080;
        color: #fff;
        text-align: center;
        vertical-align: middle;
        }

        ul.nav_bar{
        position: absolute;
        height: 50px;
        top: 50%; left: 50%;
        margin-top: -25px; margin-left: -200px;
        padding: 0px;
        list-style: none;
        text-align: center;

        }
        .bodycontent{
        display: inline-block;
        width: 100%;
        padding:15px;
        }





        Now, You can add CSS for main menu design in ul.nav_bar as per your requirements.






        .header {
        display: inline-block;
        padding: 10px;
        width: 100%;
        text-align: center;
        background-color: #F2F2F2;
        color: #424242;
        }
        body {
        margin: 0px;
        padding: 0px;
        height: 100%;
        font: 300 100% 'Helvetica Neue', Helvetica, Arial;
        }
        .footer {
        display: inline-block;
        width: 100%;;
        text-align: center;
        width: 100%;
        height: 20px;
        background-color: #808080;
        color:#fff;
        }
        .prodheading {
        display: inline-block;
        width: 100%;
        height: 20px;
        background-color: #808080;
        color: #fff;
        text-align: center;
        vertical-align: middle;
        }

        ul.nav_bar{
        position: absolute;
        height: 50px;
        top: 50%; left: 50%;
        margin-top: -25px; margin-left: -200px;
        padding: 0px;
        list-style: none;
        text-align: center;

        }
        .bodycontent{
        display: inline-block;
        width: 100%;
        padding:15px;
        }





        .header {
        display: inline-block;
        padding: 10px;
        width: 100%;
        text-align: center;
        background-color: #F2F2F2;
        color: #424242;
        }
        body {
        margin: 0px;
        padding: 0px;
        height: 100%;
        font: 300 100% 'Helvetica Neue', Helvetica, Arial;
        }
        .footer {
        display: inline-block;
        width: 100%;;
        text-align: center;
        width: 100%;
        height: 20px;
        background-color: #808080;
        color:#fff;
        }
        .prodheading {
        display: inline-block;
        width: 100%;
        height: 20px;
        background-color: #808080;
        color: #fff;
        text-align: center;
        vertical-align: middle;
        }

        ul.nav_bar{
        position: absolute;
        height: 50px;
        top: 50%; left: 50%;
        margin-top: -25px; margin-left: -200px;
        padding: 0px;
        list-style: none;
        text-align: center;

        }
        .bodycontent{
        display: inline-block;
        width: 100%;
        padding:15px;
        }






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 17 '18 at 6:27









        Joykal InfotechJoykal Infotech

        1,211316




        1,211316
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53344404%2fresolve-overlapping-elements-in-html%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Bressuire

            Vorschmack

            Quarantine