Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Padding bottom not always effective
Message
De
29/08/2017 11:45:19
 
 
À
29/08/2017 11:24:10
Information générale
Forum:
HTML5
Catégorie:
HTML
Divers
Thread ID:
01653764
Message ID:
01653824
Vues:
61
This message has been marked as the solution to the initial question of the thread.
>When removing the padding bottom, this works, when we have scroll content. But, if you remove some of that, you will see that, when we do not have a scroll, the footer is not aligned bottom.
>
>This is the code:
>
>
><html> 
>
><Style>
>body
>{
>   padding: 0px;
>   margin: 0px;
>}
>
>html,body
>{
>   height: 100%;
>}
>
>#Holder
>{
>   min-height: 100%;
>   position: relative;
>}
>
>#Body
>{
>   xpadding-bottom: 80px;
>background-color: #ff0000;
>}
>
>.Main
>{
>   padding-top: 35px;
>   padding-bottom: 35px;
>}
>
>#Footer
>{
>   position: absolute;
>   left: 0;
>   bottom: 0;
>   width: 100%;
>   min-height: 80px;
>   height: auto;
>   line-height: 80px;
>   padding-top: 10px;
>   padding-bottom: 10px;
>   border-top: 1px solid #555555;
>position: relative;
>background-color: #ffff00;
>}
>
>#Span
>{
>   display: inline-block;
>   vertical-align: middle;
>   line-height: normal;
>}
></Style>
>
><body> 
><div id="Holder"><div id="Body"><div class="Main">
>
>asfdasfasfd
><br>
>asfdasfasfd
><br>
>asfdasfasfd
>asfdasfasfd
><br>
>asfdasfasfd
><br>
>asfdasfasfd
><br>
>asfdasfasfd
><br>
>asfdasfasfd
><br>
>asfdasfasfd
><br>
>asfdasfasfd
><br>
>asfdasfasfd
>
></div><div id="Footer"><span id="Span"></span></div></div></div>
></body>
></html>
>
Does this work for you:
    #Body {
        padding-bottom: 101px;
    }

   
    #Footer {
        position: absolute;
        margin-top: -101px;
        left: 0;
        bottom: 0;
        width: 100%;
        min-height: 80px;
        height: auto;
        line-height: 80px;
        padding-top: 10px;
        padding-bottom: 10px;
        border-top: 1px solid #555555;
    }
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform