How to remove the space between two Divs?

Asked

Viewed 67 times

0

I have already researched here by SOF but the problems that appeared did not resemble mine, so I would like to know what I did wrong here: inserir a descrição da imagem aqui

I want to know how to remove this space between the two Ivs leaving them side by side.

The HTML code :

body{
        background-color: #0E6BA8;
    
        
    }
    .container{
        display: grid;
        grid-template-columns: 300px  300px 300px 300px;
        grid-template-rows: 300px  300px 300px 300px;
        display: flex;
        flex-direction: column;
        
    }
    @media(min-width: 680px){
        .container{
            display: flex;
            flex-direction: row;   
        }
    }
    .caixas{
        background-color: #A6E1FA;
        width: 280px;
        height: 280px;
        text-align: center;
        border-radius: 10px;
        border: 3px solid #0A2472;
        margin: 0 auto;
    }
    .input{
        border-radius: 8px;
        padding:5px;
    }
 


    <html>
        <head>
            <link rel="stylesheet" href="style.css">
        </head>
    
        <body>
            <div class="container">
            <div class='caixas'>
                <h2>Estrutura sequencial</h2>
                <h3>calculadora de terreno</h3>
                Digite o primeiro valor:
                <br>
                <input type='text' name='valorum' class='input'>
                <br>
                Digite o segundo valor:
                <br>
                <input type='text' name='valordois' class='input'>
                <br>
                Resultado:
                <br>
                <input type='text' name='resultado' class='input'>
            </div>
            <div class='caixas'>
                <h2>Estrutura sequencial</h2>
                <h3>calculadora de terreno</h3>
                Digite o primeiro valor:
                <br>
                <input type='text' name='valorum' class='input'>
                <br>
                Digite o segundo valor:
                <br>
                <input type='text' name='valordois' class='input'>
                <br>
                Resultado:
                <br>
                <input type='text' name='resultado' class='input'>
            </div>
            
            </div>
    
            <script type="text/javascript" src="js.js"></script>
        </body>
    </html>


    

1 answer

1


Guy inside the min-width just you remove that margin: auto, and puts justify-content: center in the container flex.

inserir a descrição da imagem aqui

Display the tb code in Fullscreen to see the result

<!DOCTYPE html>
<html>

<head>
<link rel="stylesheet" href="style.css">

<style>
  body {
    background-color: #0E6BA8;


  }

  .container {
    display: grid;
    grid-template-columns: 300px 300px 300px 300px;
    grid-template-rows: 300px 300px 300px 300px;
    display: flex;
    flex-direction: column;

  }

  .caixas {
    background-color: #A6E1FA;
    width: 280px;
    height: 280px;
    text-align: center;
    border-radius: 10px;
    border: 3px solid #0A2472;
    
    margin: 0 auto;
  }

  .input {
    border-radius: 8px;
    padding: 5px;
  }
  
    @media(min-width: 680px) {
    .container {
      display: flex;
      flex-direction: row;
      
      justify-content: center;
    }
    
    .caixas {
      margin: initial;
    }

  }
</style>
</head>

<body>
  <div class="container">
    <div class='caixas'>
      <h2>Estrutura sequencial</h2>
      <h3>calculadora de terreno</h3>
      Digite o primeiro valor:
      <br>
      <input type='text' name='valorum' class='input'>
      <br>
      Digite o segundo valor:
      <br>
      <input type='text' name='valordois' class='input'>
      <br>
      Resultado:
      <br>
      <input type='text' name='resultado' class='input'>
    </div>
    <div class='caixas'>
      <h2>Estrutura sequencial</h2>
      <h3>calculadora de terreno</h3>
      Digite o primeiro valor:
      <br>
      <input type='text' name='valorum' class='input'>
      <br>
      Digite o segundo valor:
      <br>
      <input type='text' name='valordois' class='input'>
      <br>
      Resultado:
      <br>
      <input type='text' name='resultado' class='input'>
    </div>

  </div>

  <script type="text/javascript" src="js.js"></script>
</body>

</html>

  • face, heart, THANK YOU <3

  • 1

    @Danilocosta without problems my dear, gives a studied in the adjustment I did, although simple help a lot.

Browser other questions tagged

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