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

225
Vistas
Show alert if style is not supported, without HTML

I would need something like this:

if {
  @supports not(display: grid) {
    window.alert("Please use a different browser.");
  }
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

So if CSS grid is not supported by a browser, it should show a JavaScript alert. I know how it would work with just CSS, but I need a JavaScript or jQuery solution, without any HTML in the HTML section. How is it possible to do that?

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

0

You're making this too complicated 😀

if (document.documentElement.style.grid === undefined) {
    alert("Please use a different browser.");
}

In modern browsers, grid is a property of the style of every element. If it's undefined, then the browser doesn't support it.

about 4 years ago · Juan Pablo Isaza Denunciar

0

You can create an element which is normally hidden, but becomes visible if grid is not supported. Please check out https://developer.mozilla.org/en-US/docs/Web/CSS/@supports

For example you have an element warning-message with display: none; and

@supports not (display: grid) {
  #warning-message {
    display: block;
  }
}
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