HTML Iframes are also known as inline frames, They are basically used for webpage nesting(to display a webpage within a webpage). HTML <iframe> tag is used to embed a webpage in another webpage.
Syntax
<iframe src="URL">
The web address of the embedded webpage is written in src value.
Iframe Height and Width
To specify size of inline frame height and width attribute can be used.
<!DOCTYPE html> <html> <body> <h2>HTML Iframes Example</h2> <p>Use the height and width attributes to specify the size of the iframe</p> <iframe src="https://www.tutorialsart.com/" height="400" width="400"></iframe> </body> </html>
Remove Iframe Border
An html iframe has border around it , by default which can be removed by adding CSS border property within style attribute.
<!DOCTYPE html> <html> <body> <h2>HTML Iframes Example</h2> <p>Use the height and width attributes to specify the size of the iframe</p> <iframe src="https://www.tutorialsart.com/" height="400" width="400" title="tutorialsart" style="border:none;"></iframe> </body> </html>
Note: It is better to add html title attribute so that if there is error showing iframe than the text written in title attribute will be shown to the user.
Tip: Other CSS properties can be used to change style of iframe.