HTML DOM IFrame Height Property - W3Schools
Có thể bạn quan tâm
❮ IFrame Object
Example
Change the height of an iframe:
document.getElementById("myFrame").height = "400"; Try it Yourself »Description
The height property sets or returns the value of the height attribute in an iframe element.
The height attribute specifies the height of an iframe.
Tip: Use the width property to set or return the value of the width attribute in an iframe.
Browser Support
| Property | |||||
|---|---|---|---|---|---|
| height | Yes | Yes | Yes | Yes | Yes |
Syntax
Return the height property:
iframeObject.heightSet the height property:
iframeObject.height = pixelsProperty Values
| Value | Description |
|---|---|
| pixels | The height in pixels (like "100px" or just "100") |
Technical Details
| Return Value: | A String, representing the height of the iframe, in pixels |
|---|
More Examples
Example
Return the height of an iframe:
var x = document.getElementById("myFrame").height; Try it Yourself »Example
Change the height and width of an iframe:
document.getElementById("myFrame").height = "400";document.getElementById("myFrame").width = "400"; Try it Yourself »Related Pages
HTML reference: HTML <iframe> height attribute
❮ IFrame Object ★ +1 Sign in to track progressTừ khóa » Html Iframe Adjust Height To Content
-
Make Iframe Automatically Adjust Height According To The Contents ...
-
Automatically Adjust IFrame Height According To Its Contents Using ...
-
How To Adjust The Width And Height Of Iframe To Fit With Content In It
-
Adjust IFrame Height According To Its Contents Code Example
-
Change Iframe Size Automatically To Fit Content & Prevent Scrollbars
-
Auto-resize Iframe When Content Size Changes - WillMaster
-
Iframe Auto Adjust Height As Content Changes
-
HTML Iframe Height Attribute - W3Schools
-
Resize Iframe To Fit Content (Same Domain Only) - CSS-Tricks
-
How To Adjust Width And Height Of Iframe To Fit With Content In It
-
Auto Adjust HTML IFrame Height According To Page Contents JS
-
How To Automatically Resize An Iframe | By Bret Cameron
-
3 Ways To Resize IFrames In HTML - WikiHow
-
Auto Adjust Height Of Iframe Based On Content - Mobirise Forums