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

242
Vistas
(CSS iframe:focus) Is there a bug on w3schools.com?

I have read on w3schools.com that there is this default value in every browser:

iframe:focus { outline: none; }

So I tried to change it to

iframe:focus { outline: 10px solid red; }

Here is the example (You have to click the first button and then use tab to navigate to the iframe.):

iframe:focus
{
  outline:10px solid red;
}

input:focus
{
  background:blue;
}
<input type="button" value="button1" />
<input type="button" value="button2" />
<iframe src="about:blank"></iframe>
As you can see, the iframe never gets a red outline. Thus the CSS is not working. I also tried to set the focus using JavaScript .focus() and it also doesn't work.

It seems that an iframe can't get the focus. The same is said in 34157775.

So my question is: Why is there a default value for iframe:focus on w3schools.com if an iframe can't even get the focus? Is this a bug on w3schools.com?

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