Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

95
Vistas
no style change when disabling fieldset

how do I make my disabled and enabled <fieldset> look the same?

i.e. when toggling disabled no difference should be visible

I tried this but it doesn't work:

fieldset{
  opacity:1 !important;
  border:0;
}

fieldset:disabled{
 opacity:1 !important;
}

fieldset:disabled *{
 opacity:1 !important;
}
<fieldset disabled>
  <select>
   <option>testing</option>
  </select>
</fieldset>

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

You could use initial, note that it is not supported on internet explorer.

fieldset {
  border: 0;
}

fieldset:disabled * {
  opacity: initial;
  color: initial;
}
<fieldset disabled>
  <select>
   <option>testing</option>
  </select>
</fieldset>

about 4 years ago · Juan Pablo Isaza Denunciar

0

Try using pointer-events:none; this disables the form while still keeping the background same

fieldset {
  border: 0;
}

.disabled *{
 pointer-events:none;
}
<fieldset class='disabled'>
  <select>
   <option>testing</option>
  </select>
</fieldset>

I've used .disabled * so that the click events on the fieldset itself can still be detected

about 4 years ago · Juan Pablo Isaza Denunciar

0

One way, making sure it looks the same when disabled, is to explicitly set the various colors as well as the opacity.

fieldset,
fieldset>* {
  background-color: white;
  border-color: black;
  color: black;
  opacity: 1;
}
<fieldset disabled>
  <select>
    <option>testing</option>
  </select>
</fieldset>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda