Iframes in HTML
Iframes in HTML
Iframe
❑An HTML iframe is used to display a web page within a
web page.
HTML Iframe Syntax
❑ The HTML <iframe> tag specifies an inline frame.
❑ An inline frame is used to embed another document within the current HTML
document
Iframe - Set Height and Width
❑ Use the height and width attributes to specify the size of the iframe.
Example
<iframe src="demo_iframe.htm" height="200" width=
"300" title="Iframe Example"></iframe>
you can add the style attribute and use the CSS height and width properties
<iframe src="demo_iframe.htm" style="height:200px;width:300px;" title="Iframe
Example"></iframe>
The HTML <head> Element
❑ The <head> element is a container for metadata (data about data) and is placed
between the <html> tag and the <body> tag.
❑ HTML metadata is data about the HTML document. Metadata is not displayed.
❑ Metadata typically define the document title, character set, styles, scripts, and
other meta information.
❑ The HTML <head> element is a container for the following
elements: <title>, <style>, <meta>, <link>, <script>, and <base>
<!DOCTYPE html>
<html>
<head>
<title>A Meaningful Page Title</title>
</head>
<body>
</body>
</html>
HTML Layout Elements
❑ HTML has several semantic elements that define the different parts of a web
page
/* Responsive layout - makes the two columns/boxes stack on top of each other instead of next to each
other, on small screens */
@media (max-width: 600px) {
nav, article {
width: 100%;
height: auto;
}
}
</style>