Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

237
Views
(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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!