HTML iFrame

Links to HTML projects source code & tutorials
Site Admin
Posts: 159
Joined: Sun Jun 26, 2022 10:46 pm

HTML iFrame

Post by C0D3D »

Using an iframe to embed a web page inside another HTML document

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>
Removing the default frameborder from an iframe

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>               
Opening linked web pages inside an iframe

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>
----------------------------------------------------------------------
Together we are one! One we are many... Much Love from one brother to another...
Working together to achieve amazing things!
Teamwork is key.
Knowledge is Power!

4 Basic datatypes.
Strings: Which store a series of characters.
Int: Which store a full integer or number.
Float: A numeric value with a decimal.
Boolean: Only stores True or False and are very useful with if statements

----------------------------------------------------------------------
ImgBB Image upload

Who is online

Users browsing this forum: No registered users and 0 guests