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

129
Views
How to move div to the center of the screen from iframe?

There is the following code of main HTML file:

<!DOCTYPE html>
<html>
  <head>
    <title>Read Text File</title>
  </head>
  
  <body>
    <iframe src="http://localhost:8092/iframe.html"/>
  </body>
</html>

And there is code of iframe:

<!DOCTYPE html>
<html>
  <head>
    <title>Read Text File</title>
  </head>
    
  <body>
    <div id="text">This just text</div>
    <button id="btn">Click</button>
    <div id="popup">Center</div>
    <script>
      document.querySelector('#btn').addEventListener('click', () => {
        alert('center');
      });
    </script>
  </body>
</html>

As you can see, my main file includes iframe. My question: is it possible to put div with id "popup" in center of the screen (not only iframe)? Domain of main file and domain of iframe are not the same.

Thanks in advance.

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!