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

149
Visualizações
Hiddeln section not displaying correctly

I have this hidden section with the display:none. The div with the TextBox control is using col-md-11 but when switch the display this section looks like it is only taking up about col-md-5. Is there anything I can do to make sure this is using the correct space?

<div class="col-md-11 !important">
     <div class="form-group">
     <label class="control-label source-label">Other</label>
     <input class="form-control" id="enteredOtherSource" name="enteredOtherSource[0].Other" type="text" value="">
     <span class="field-validation-valid text-danger" data-valmsg-for="enteredOtherSource[0].Other" data-valmsg-replace="true"></span>
     </div>
     <input value="91" data-val="true" data-val-number="The field SourceId must be a number." data-val-required="The SourceId field is required." id="otherSourceId" name="enteredOtherSource[0].SourceId" type="hidden">
</div>

enter image description here

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

0

display: none causes the page to be rendered as if the element does not exist, so the space it would have occupied is filled with the next element.

To reserve space visibility: hidden can be used.

The working snippet below shows sets of three divs where the middle one is either removed with display:none or hiddent with visibility:hidden

div {
  width: 100%;
  border: 1px solid black;
  background: yellow;
  padding: 3px;
}

.hidden {
  visibility: hidden;
}

.none {
  display: none;
}

.container {
  width: 60%;
  padding: 15px;
  background: red;
  border: 1px solid black;
}
<div class='container'>
  Three normal divs, the middle one will have a style applied to hide or make it invisible in the lower panels
  <div>1 - normal div </div>
  <div>2 - none or visibility hidden below</div>
  <div>3 - normal div </div>
</div>
<p> </p>
<div class='container'>
  When using `display:none` the div and its space disappear:
  <div>1 - normal div </div>
  <div class="none">2 - display will be none</div>
  <div>3 - normal div </div>
</div>
<p> </p>
<div class='container'>
  when using `visibility: hidden` the div disappears but its space is reserved:
  <div>1 - normal div </div>
  <div class="hidden">2 - display will be none</div>
  <div>3 - normal div </div>
</div>

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