Doubt in the padding bottom

Asked

Viewed 35 times

-2

Does anyone know the ERROR of this code? the paddim bottom simply doesn’t work... thank you

<html>

  <head>
    <title>Olá, me chamo Ana</title>
    
    <style>
      body{
        font-family: Arial;
      }
      .caixa1 {
        padding-top: 80px;
        padding-bottom: 40px;
        text-align: center;
      }  


      .caixa2 {
        background: #7134eb;
        height: 300px;
      }  
      .caixa3 {
        height: 300px;
      }  

       h1 {
        text-align: center;
        font-size: 48px;
      }

       p {
        text-align: center
       }

       img{
         height: 150px;
       }
    </style>
  </head>

  <body>

    <div class="caixa1">
      <h1> LIA </h1>

      <p> Testando </p>
      

      <img src="catioro.jpg">

    <div class="caixa2">Caixa 2</div>
    <div class="caixa3">Caixa 3</div>
  </body>

</html>

  • 2

    Yes it works! is applying normally, you can check https://prnt.sc/trgaus

  • 1

    It seems to be working, but note that its <div class="caixa1"> has no end </div>

1 answer

0

Make sure to close your <div class="caixa1"></div> so that the padding-bottom "inner margin" is in the location you want, otherwise your browser may be closing it automatically before the end of the page or even before the div.box2

  • Whoa, I don’t understand...

Browser other questions tagged

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