Sie sind auf Seite 1von 12

HTML Frames Referencing

Frames Referencing
• Use Name attribute to assign a name to a specific frame.
• Use Target attribute to reference from one frame to another.
• E.g
<frame src=“webpage.html” name=“home”>

• Then use target attribute of <a> tag to refer to home frame

<a href=“Homepage.html” target=“home” />


Example
<html>
<head>
<title> Frames Referencing </title>
</head>

<frameset cols=20%,80%>
<frame src="links.html">
<frame src="" name=“home” >
</frameset>

</html>
Example(cont)
<html>

<body>
<ol>
<li><a href="../../homepage.html" target=home>Homepage</a></li>
<li><a href="../../Lists.html" target=home>Lists</a></li>
<li><a href="../../LinkParts.html" target=home>Link Parts</a></li>
<li><a href="../../Table-3.html" target=home>Tables</a></li>
<li><a href="../../Headings.html" target=home>Headings</a></li>
</ol>
</body>

</html>
Target Attribute
<a> Target Attribute
• There are four target attribute values for <a> tag

_blank Opens the linked document in a new


window or tab
_self Opens the linked document in the same
frame as it was clicked (this is default)
_top Opens the linked document in the full body
of the window
_parent Opens the linked document in the parent
frame
Iframe
Iframe
• The <iframe> tag is somehow related to <frameset> tag.
instead, it can appear anywhere in your document.
• The <iframe> tag defines a rectangular region within the document in
which the browser can display a separate document, including
scrollbars and borders.
Example
<html>
<body>

<iframe src="../../Lists.html" width="555" height="200">


Sorry your browser does not support inline frames.
</iframe>

</body>

</html>
Example
• Youtube Iframe

• <iframe width="560" height="315"


src="https://www.youtube.com/embed/J14DZ0J5O5k"
frameborder="0" allowfullscreen></iframe>
<video> Tag
• Use <video> tag to add videos from local drives

<html>

<body>
<video width="720" height="240" controls>
<source src="videos/1.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</body>

</html>
<audio> Tag
• Use <video> tag to add videos from local drives

<html>

<body>
<audio controls>
<source src=“song.mp3" type=“audio/mp3">
Your browser does not support the audio tag.
</audio>
</body>

</html>

Das könnte Ihnen auch gefallen