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

226
Vistas
How can i apply a border to a div element when it is focused, using tailwind?

I have a rounded div containing a button (i wanted to create a rounded "add button") and i'd like to apply a different border color to this div when it is focused, but i can't get the hoped result using the :focus modifier. This is what i tried

<div:class="
['flex
rounded-full
border border-blue-100
h-12 w-12
justify-center
absolute
bottom-10
right-5
focus:border-red-500'
]">
    <button type="button" class="text-5xl">+</button>
</div>"

However the border does not change color

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

0

The DIV is not focusable - you should apply the classes on the BUTTON itself:

<button class="text-5xl flex rounded-full border border-blue-100 h-12 w-12 justify-center items-center focus:border-red-500">+</button>
about 4 years ago · Juan Pablo Isaza Denunciar

0

the div is not focusable so you have to apply the border to button or there is another way that

you do focus-within instead of focus on div

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