PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, December 2, 2022

[FIXED] How do I set a custom viewport for an iframe?

 December 02, 2022     css, html, iframe     No comments   

Issue

Okay. Actually, maybe the title makes no sense.

Please read:

I want to create an iframe with a custom width. Okay. Please try to understand.

I don't want the iframe to be responsive (the site embedded in the iframe is responsive) and I want it to appear like a shrunk picture.

I can give you some examples if you wish. Any idea how to do this?


Solution

you can scale the iframe using css transform. for example, if you'd like to make the page within the iframe to display at half size..

iframe {
  transform: scale(0.5, 0.5);
  height: 1000px;
  width: 1000px;
}
<iframe src="https://example.com"></iframe>

That should display a 1000x1000 viewport of the page shrunk down to a 500x500 iframe.



Answered By - jared eiseman
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing