Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

238
Visualizações
(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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda