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

260
Vistas
Is there any way to change a <div> class basing on visitors' device?

I'm currently using my wordpress blog homepage with latest posts shown in 2 columns, which looks very nicely when visited by PC and Mac large screen but, at the same time, it's terrible when visited by mobile.

So I was wondering if I could use javascript or something else to change the <div> that splits the homepage into 2 column posts, into another <div> when visited not by large screens.

For example:

<script>
if ((!pc && !osx))
{ echo('<div class="half">';
}
else {echo('<div class="container">');
}
</script>

Any hint how to do?

about 4 years ago · Juan Pablo Isaza
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