-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtml_iframe.html
More file actions
267 lines (258 loc) · 16.6 KB
/
html_iframe.html
File metadata and controls
267 lines (258 loc) · 16.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>html iframes | html</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css"
integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="media_query.css">
<link rel="stylesheet" href="html_iframe.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Bree+Serif&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap');
</style>
</head>
<body>
<header>
<nav class="main">
<ul>
<li class="stop_breaking"><i class="fa-solid fa-code"></i> LearnToCode</li>
<li class="list_item"></li>
</ul>
<ul class="list">
<li><a href="">Home</a>
<hr class="active">
</li>
<li class="stop_breaking tutorials">
<a href="">Tutorials <i class="fa-solid fa-arrow-down"></i></a>
<ul class="dropdown">
<li><a href="html.html">HTML</a></li>
<li><a href="">CSS</a></li>
<li><a href="">JavaScript</a></li>
</ul>
</li>
<li><a href="">Videos</a></li>
</ul>
<ul class="list">
<li><a href="sign_up.html" class="signup">SignUp</a></li>
<li><a href="log_in.html" class="login">LogIn</a></li>
</ul>
</nav>
</header>
<div class="thin_nav_strip">
<a href="javascript:void(0);" onclick="sidebar_toggle()">Toggle<i class="fa-solid fa-bars"
onmousedown="return false" onselectstart="return false"></i></a>
<a href="index.html"><i class="fa-solid fa-house"></i></a>
<a href="html.html">HTML</a>
<a href="">CSS</a>
<a href="">JavaScript</a>
</div>
<main>
<!-- Sidebar Navigation,I'm excited about it -->
<div class="side_navbar-outer">
<div class="side_navbar-inner">
<h2>HTML Tutorials</h2>
<a href="html.html">HTML Introduction</a>
<a href="html_heading.html">HTML Headings</a>
<a href="html_paragraph.html">HTML Paragraphs</a>
<a href="html_formatting.html">HTML Formatting</a>
<!-- html links -->
<a href="javascript:void(0);" onclick="links_toggle()">HTML Links <label for="links_dropdown"><i
class="fa-solid fa-bars"></i></label></a>
<!-- <input type="checkbox" id="links_dropdown"> -->
<div class="sidebar_links_dropdown">
<ul class="sidebar_links_dropdown_menu">
<li><a href="html_links/html_links.html">Links</a></li>
<li><a href="html_links/html_links_link_colors.html">Link Colors</a></li>
<li><a href="html_links/html_links_link_bookmarks.html">Link Bookmarks</a></li>
</ul>
</div>
<!-- html images -->
<a href="javascript:void(0);" onclick="images_toggle()">HTML Images <label
for="images_dropdown"><i class="fa-solid fa-bars"></i></label></a>
<!-- <input type="checkbox" id="images_dropdown"> -->
<div class="sidebar_images_dropdown">
<ul class="sidebar_images_dropdown_menu">
<li><a href="html_images/html_images.html">Images</a></li>
<li><a href="html_images/html_image_maps.html">Image Map</a></li>
<li><a href="html_images/html_background_images.html">Background Images</a></li>
<li><a href="html_images/html_picture_element.html">The Picture Element</a></li>
</ul>
</div>
<!-- html tables -->
<a href="javascript:void(0)" onclick="tables_toggle()">HTML Tables <i class="fa-solid fa-bars"></i></a>
<div class="sidebar_dropdown tables_dropdown">
<ul class="sidebar_dropdown_menu">
<li><a href="html_tables/html_tables.html">HTML Tables</a></li>
<li><a href="html_tables/html_table_borders.html">Table Borders</a></li>
<li><a href="html_tables/html_table_sizes.html">Table Sizes</a></li>
<li><a href="html_tables/html_table_headers.html">Table Headers</a></li>
<li><a href="html_tables/html_table_padding_spacing.html">Padding & Spacing</a></li>
<li><a href="html_tables/html_table_colspan_rowspan.html">Colspan & Rowspan</a></li>
<li><a href="html_tables/html_table_styling.html">Table Styling</a></li>
<li><a href="html_tables/html_table_colgroup.html">Table Colgroup</a></li>
</ul>
</div>
<!-- html lists -->
<a href="javascript:void(0)" onclick="lists_toggle()">HTML Lists <i class="fa-solid fa-bars"></i></a>
<div class="sidebar_dropdown lists_dropdown">
<ul class="sidebar_dropdown_menu">
<li><a href="html_lists/lists.html">Lists</a></li>
<li><a href="html_lists/html_unordered_list.html">Unordered Lists</a></li>
<li><a href="html_lists/html_ordered_lists.html">Ordered Lists</a></li>
<li><a href="html_lists/html_other_lists.html">Other Lists</a></li>
</ul>
</div>
<a href="html_block_inline.html">HTML Block & Inline</a>
<a href="html_class.html">HTML Classes</a>
<a href="html_id.html">HTML Id</a>
<a href="html_iframe.html">HTML Iframes</a>
<a href="html_javascript.html">HTML JavScript</a>
<a href="html_file_path.html">HTML File Paths</a>
<a href="html_head.html">HTML Head</a>
<a href="html_layout.html">HTML Layout</a>
<a href="html_responsive.html">HTML Responsive</a>
</div>
</div>
<div class="main_content">
<h2>HTML Iframes</h2>
<div class="previous_next">
<a href="html_id.html" class="previous"><i class="fa-solid fa-angle-left"></i>Previous</a>
<a href="html_javascript.html" class="next">Next<i class="fa-solid fa-angle-right"></i></a>
</div>
<hr class="line">
<p>An HTML iframe is used to display a web page within a web page.</p>
<hr class="line">
<center><iframe src="index.html" frameborder="0"></iframe></center>
<hr class="line">
<div class="html_iframe_syntax">
<h2>HTML Iframe Syntax</h2>
<p>The HTML <span class="styling_the_span"><iframe></span> tag specifies an inline frame. <br>An inline frame is used to embed another document within the current HTML document.</p>
<div class="alpha">
<h2>Example:</h2>
<div class="beta">
<span>
<span class="blue"><</span><span class="brown">iframe</span> <span class="red">src</span>=<span class="blue">"url"</span> <span class="red">title</span>=<span class="blue">"description"><</span><span class="brown">/iframe</span><span class="blue">></span>
</span>
</div>
<div class="link_to_code_editor">
<a href="codeEditor/index.html" target="_blank">Try it Yourself <i
class="fa-solid fa-angle-right"></i><i class="fa-solid fa-angle-right"></i></a>
</div>
</div>
<div class="note">
<p><b>Tip: </b>It is a good practice to always include a <span class="styling_the_span">title</span> attribute for the <span class="styling_the_span"><iframe></span>. This is used by screen readers to read out what the content of the iframe is.</p>
</div>
</div>
<hr class="line">
<div class="iframe_set_height_and_width">
<h2>Iframe-Set Height and Width</h2>
<p>Use the <span class="styling_the_span">height</span> and <span class="styling_the_span">width</span> attributes to specify the size of the iframe. <br>The height and width are specified in pixels by default:</p>
<div class="alpha">
<h2>Example:</h2>
<div class="beta">
<span>
<span class="blue"><</span><span class="brown">iframe</span> <span class="red">src</span>=<span class="blue">"index.html"</span> <span class="red">height</span>=<span class="blue">"300px"</span> <span class="red">width</span>=<span class="blue">"600px"</span> <span class="red">title</span>=<span class="blue">"Iframe example"></span><span class="blue"><</span><span class="brown">/iframe</span><span class="blue">></span>
</span>
</div>
<div class="link_to_code_editor">
<a href="codeEditor/index.html" target="_blank">Try it Yourself <i
class="fa-solid fa-angle-right"></i><i class="fa-solid fa-angle-right"></i></a>
</div>
</div>
<p>Or you can add the span attribute and use the CSS height and width properties:</p>
<div class="alpha">
<h2>Example:</h2>
<div class="beta">
<span class="blue"><</span><span class="brown">iframe</span> <span class="red">src</span>=<span class="blue">"demo_iframe.html"</span> <span class="red">style</span>=<span class="blue">"height:200px; width:300px;"</span> <span class="red">title</span>=<span class="blue">"Iframe example"></span><span class="blue"><</span><span class="brown">/iframe</span><span class="blue">></span>
</div>
<div class="link_to_code_editor">
<a href="codeEditor/index.html" target="_blank">Try it Yourself <i
class="fa-solid fa-angle-right"></i><i class="fa-solid fa-angle-right"></i></a>
</div>
</div>
</div>
<hr class="line">
<div class="iframe_remove_the_border">
<p>By default, an iframe has a border around it. <br>To remove the border, add the <span class="styling_the_span">style</span> attribute and use the CSS <span class="styling_the_span">border</span> property:</p>
<div class="alpha">
<h2>Example:</h2>
<div class="beta">
<span class="blue"><</span><span class="brown">iframe</span> <span class="red">src</span>=<span class="blue">"demo_iframe.html"</span> <span class="red">style</span>=<span class="blue">"border:none;"</span> <span class="red">title</span>=<span class="blue">"Iframe example"></span><span class="blue"><</span><span class="brown">/iframe</span><span class="blue">></span>
</div>
<div class="link_to_code_editor">
<a href="codeEditor/index.html" target="_blank">Try it Yourself <i
class="fa-solid fa-angle-right"></i><i class="fa-solid fa-angle-right"></i></a>
</div>
</div>
</div>
<hr class="line">
<div class="iframe_target_for_a_link">
<h2>Iframe - Target for a Link</h2>
<p>An iframe can be used as the target frame for a link. <br>The <span class="styling_the_span">target</span> attribute of the link must refer to the <span class="styling_the_span">name</span> attribute of the iframe:</p>
<div class="alpha">
<h2>Example:</h2>
<div class="beta">
<span>
<span class="blue"><</span><span class="brown">iframe</span> <span class="red">src</span>=<span class="blue">"demo_iframe.html"</span> <span class="red">name</span>=<span class="blue">"iframe"</span> <span class="red">title</span>=<span class="blue">"Iframe example"></span>
<span class="blue"><</span><span class="brown">/iframe</span><span class="blue">></span>
</span> <br>
<span>
<span class="blue"><</span><span class="brown">p</span><span class="blue">></span><span class="blue"><</span><span class="brown">a</span> <span class="red">href</span>=<span class="blue">"https://www.helloworld.com"</span> <span class="red">target</span>=<span class="blue">"iframe"></span>helloworld.com<span class="blue"><</span><span class="brown">/a</span><span class="blue">></span><span class="blue"><</span><span class="brown">/p</span><span class="blue">></span>
</span>
</div>
<div class="link_to_code_editor">
<a href="codeEditor/index.html" target="_blank">Try it Yourself <i
class="fa-solid fa-angle-right"></i><i class="fa-solid fa-angle-right"></i></a>
</div>
</div>
</div>
<hr class="line">
<div class="chapter_summary">
<h2>Chapter Summary</h2>
<ul>
<li>The HTML <span class="styling_the_span"><iframe></span> tag specifies an inline frame</li>
<li>The <span class="styling_the_span">src</span> attribute defines the URL of the page to embed</li>
<li>Always include a <span class="styling_the_span">title</span> attribute (for screen readers)</li>
<li>The <span class="styling_the_span">height</span> and <span class="styling_the_span">width</span> attributes specify the size of the iframe</li>
<li>Use <span class="styling_the_span">border:none;</span> to remove the border around the iframe</li>
</ul>
</div>
<div class="previous_next">
<a href="html_id.html" class="previous"><i class="fa-solid fa-angle-left"></i>Previous</a>
<a href="html_javascript.html" class="next">Next<i class="fa-solid fa-angle-right"></i></a>
</div>
<!-- Footer -->
<hr class="line">
<div class="footer">
<button onclick="report_error_toggle()">Report Error</button>
<div class="report_error">
<h3>Report error:</h3>
<p>If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail: <span>shaurya.y321@gmail.com</span></p>
</div>
<div class="forum_about">
<a href="">Forum</a> | <a href="about.html">About</a>
</div>
<div class="paragraphs">
<p>LearnToCode is optimized for learning and training. Examples might be simplified to improve
reading
and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but
we
cannot warrant full correctness of all content. While using LearnToCode, you agree to have read
and
accepted our <a href="">terms of use</a>, <a href="">cookie and privacy policy</a>.</p>
<p><a href="">Copyright 1999-2022</a> by Auxilium Info. All Rights Reserved. <a href="">LearnToCode
is
Powered by Auxilium</a></p>
</div>
</div>
</div>
</main>
<script src="script.js"></script>
</body>
</html>