Example 1
Code: Select all
<!DOCTYPE html>
<html lang="en">
<head>
<title>Specify iFrame Dimensions in HTML</title>
</head>
<body>
<h2>Specify Width and Height Using Attributes</h2>
<iframe src="/index.html" width="400" height="200"></iframe>
<hr>
<h2>Specify Width and Height Using CSS</h2>
<iframe src="/index.html" style="width: 400px; height: 200px;"></iframe>
</body>
</html>
Example 2
Code: Select all
<!DOCTYPE html>
<html lang="en">
<head>
<title>Removing Borders from iFrame Using CSS</title>
</head>
<body>
<iframe src="/index.html" style="border: none;"></iframe>
</body>
</html>
Example 3
Code: Select all
<!DOCTYPE html>
<html lang="en">
<head>
<title>Opening Links in an iFrame</title>
<style>
iframe {
width: 100%;
height: 500px;
}
</style>
</head>
<body>
<iframe src="/index.html" name="myFrame"></iframe>
<p><a href="https://codedskills.net" target="myFrame">Open CodedSkills</a></p>
</body>
</html>