Problems with the footer div

Asked

Viewed 94 times

0

Good morning, you guys, I’m having trouble with my baseboard div. Whenever I use the shortcut CTRL + (+), there comes a time when the footer is filling the bottom of the page. Is there any way I can solve this? Below is the code of the html page:

<div id="footer">
    <div id="corpo">

        <div id="coluna1">
            Congregação São João - RJ<br>
            CNPJ: 27-001/11.280.416<br>
            CEP: 250-25-515<br>
            Rua: Santo Antônio, nº523<br>
            Centro - São João de Mereti/RJ

        </div>  

        <div id="coluna2">
            Congregação Pau Grande - Magé/RJ<br>
            CEP: 25.933-145<br>
            Rua: Lindsay Anderson, nº 15<br>
            Pau Grande - Magé/RJ

        </div>

        <div id="coluna2">
            Congregação Santa Inês - Vila Velha/ES<br>
            CEP: 29.108-041<br>
            Rua: Avenida Rui Braga Ribeiro, nº961<br>
            Santa Inês - Vila Velha/ES
        </div>

    </div>
</div>

And the css:

#footer {
    position: relative;
    margin-top: -150px; /* valor negativo da altura do rodapé */
    width: 100%;
    height: 150px;
    clear: both;
    background-repeat: no-repeat; 
    background-position: center right;
    background-color: #7d0d0d;  
}

#textorodape{
    margin-right: 100px; 
    color: white; 
    font-size: 16px;
    position: center right; 
}

#coluna1 {
    float: left;
    width: 333px;
    color: white;
    font-size: 14px;
}

#coluna2 {
    float: left; 
    width: 333px;
    color: white;
    font-size: 14px;
}
  • Julio, I think you could send the html as well, because I didn’t understand where column1 and column2 are being used, I imagine #footer is the id of a div, but the textorodape is also id or class? is used in a div?

  • Thanks @Eduardomendes, this textoropade is an id, but I’m not using it. I’ll send the html, just a minute!

  • @Eduardomendes, ready, edited!

2 answers

2

My suggestion is to use the size of in percentage. I imagine you have another above the . In the example below I added a calling for and put its size in percentage. Note also that I put the tags and with width and height at 100%. Then the with 85% and the with 15%. This way, the zoom will not influence the size of , only in the size of .

See the :

html, body {
    width:100%;
    height:100%;
    padding: 0;
    margin: 0;  
}

#conteudo {
    width:100%;
    height:85%;
    background:#FFED00; 
}

#footer {
    position: relative;
    /*margin-top: -150px;*/ /* valor negativo da altura do rodapé */
    width: 100%;
    height: 15%;
    clear: both;
    background-repeat: no-repeat; 
    background-position: center right;
    background-color: #7d0d0d;  
}

#textorodape{
    margin-right: 100px; 
    color: white; 
    font-size: 16px;
    position: center right; 
}

.coluna1 {
    float: left;
    width: 333px;
    color: white;
    font-size: 14px;
}

.coluna2 {
    float: left; 
    width: 333px;
    color: white;
    font-size: 14px;
}

And here the

<div id="conteudo"></div>

<div id="footer">
    <div id="corpo">

        <div class="coluna1">
            Congregação São João - RJ<br>
            CNPJ: 27-001/11.280.416<br>
            CEP: 250-25-515<br>
            Rua: Santo Antônio, nº523<br>
            Centro - São João de Mereti/RJ

        </div>  

        <div class="coluna2">
            Congregação Pau Grande - Magé/RJ<br>
            CEP: 25.933-145<br>
            Rua: Lindsay Anderson, nº 15<br>
            Pau Grande - Magé/RJ

        </div>

        <div class="coluna2">
            Congregação Santa Inês - Vila Velha/ES<br>
            CEP: 29.108-041<br>
            Rua: Avenida Rui Braga Ribeiro, nº961<br>
            Santa Inês - Vila Velha/ES
        </div>

    </div>
</div>

Note: It is not recommended to have more than one in the code , when this happens the ideal is to replace by , in the case of .

  • Thank you very much, it worked correctly!!

  • Beauty. If you find it necessary, then mark the answer as useful and accept there as the best answer. Hugs

-2

You’ve tried leaving css like this ?

.footer { position:absolute;

With this, your footer will no longer be changed by the browser zoom.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.