Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

162
Visualizações
put image beside div

I have this, which is basically a table, with two columns, and I am trying my best to make the elements in said table, mobile responsive:

setTimeout(function() {
         odometer.innerHTML = '1925'
     })
.fiftyFiftySection {
    background-color: #000;
  }
  .odometer {
    font-size: 3em;
    text-align: center;
    width: 180px;
  }
    table td{
      column-width: 1000px;
      text-align: center;
  }
  #dollarSign {
    height: 50px; 
    width: 30px;
    }
    #fiftyFiftySignImage {
      width:400px; 
      height:300px; 
      margin-left: -100px;
    }
  @media (max-width: 500px) {
    table td{
      column-width: 100px;
      text-align: left;
    }
    #dollarSign {
      /* uncomment out display when you want it to display */
      /* display: none; */
      width: 20px;
      height: 20px;
    }
    #currentEstimatedPayout {
      display: none;
    }
    #odometer {
      margin-right: 50px;
      margin-top: 20px;
    }
    #fiftyFiftySignImage {
      width:300px; 
      height:200px;
      margin-left: -50px;
    }
  }
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/odometer@0.4.8/themes/odometer-theme-train-station.css"> 
    <script src="https://cdn.jsdelivr.net/npm/odometer@0.4.8/odometer.min.js"></script>
<section class="fiftyFiftySection" id="fiftyFiftySection">
  <table>
    <tr>
      <th></th>
      <th></th> 
    </tr>
    <tr>
      <td>
        <img id="fiftyFiftySignImage" src="https://res.cloudinary.com/piersolutions/image/upload/v1637109327/5050_frfhsy.png">
      </td> 
      <td>
        <h4 id="currentEstimatedPayout" style="color: #ffffff;">Current Estimated Payout</h4>
        <!-- <br> -->
        <img id="dollarSign" src="https://res.cloudinary.com/piersolutions/image/upload/v1637361906/dollar-sign-2_a2hsh3.png" alt=""><div id="odometer" class="odometer">000000</div>
      </td>
    </tr>
  </table>
</section>

but as you can see, on mobile version, it puts the dollar sign image on top of the odometer, when I need it beside it! I don't know how to fix this, i've tried so many different things. any ideas?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Add a div and use flex to align.

setTimeout(function() {
         odometer.innerHTML = '1925'
     })
.fiftyFiftySection {
    background-color: #000;
  }
  .odometer {
    font-size: 3em;
    text-align: center;
    width: 180px;
  }
    table td{
      column-width: 1000px;
      text-align: center;
  }
  #dollarSign {
    height: 50px; 
    width: 30px;
    }
    #fiftyFiftySignImage {
      width:400px; 
      height:300px; 
      margin-left: -100px;
    }
  @media (max-width: 500px) {
    table td{
      column-width: 100px;
      text-align: left;
    }
    #dollarSign {
      /* uncomment out display when you want it to display */
      /* display: none; */
      width: 20px;
      height: 20px;
    }
    #currentEstimatedPayout {
      display: none;
    }
    #odometer {
      margin-right: 50px;
      margin-top: 20px;
    }
    #fiftyFiftySignImage {
      width:300px; 
      height:200px;
      margin-left: -50px;
    }
  }
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/odometer@0.4.8/themes/odometer-theme-train-station.css"> 
    <script src="https://cdn.jsdelivr.net/npm/odometer@0.4.8/odometer.min.js"></script>
<section class="fiftyFiftySection" id="fiftyFiftySection">
  <table>
    <tr>
      <th></th>
      <th></th> 
    </tr>
    <tr>
      <td>
        <img id="fiftyFiftySignImage" src="https://res.cloudinary.com/piersolutions/image/upload/v1637109327/5050_frfhsy.png">
      </td> 
      <td>
        <h4 id="currentEstimatedPayout" style="color: #ffffff;">Current Estimated Payout</h4>
        <!-- <br> -->
        <div style="
display: flex;
justify-content: center;
align-items: center;
">
        <img id="dollarSign" src="https://res.cloudinary.com/piersolutions/image/upload/v1637361906/dollar-sign-2_a2hsh3.png" alt=""><div id="odometer" class="odometer">000000</div>

      </td>

    </tr>
  </table>
</section>

about 4 years ago · Juan Pablo Isaza Relatório

0

Use this code.

#dollarSign {
    vertical-align: middle;
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda