HTML Session 4
HTML Links - Hyperlinks
• You can click on a link and jump to another
document.
• When you move the mouse over a link, the mouse
arrow will turn into a little hand.
• The HTML <a> tag defines a hyperlink.
◆ perform creates <a> (is short for anchor)
HTML Links - Syntax
It has the following
syntax :
• The most important attribute of the <a> element is the href attribute,
which indicates the link's destination.
• Clicking on the link text, will send the user to the specified URL address.
HTML Links - The target Attribute
• By default, the linked page will be displayed in the current browser window.
• To change this, you must specify another target for the link.
• The target attribute specifies where to open the linked document.
The target attribute can have one of the following values:
◆ _self : Default. Opens the document in the same window/tab as it was clicked.
◆ _blank : Opens the document in a new window or tab.
HTML Links - The target Attribute
Code :
Browser :
HTML Images
HTML Images Syntax :
• The HTML <img> tag is used to embed an image in a web page.
• The <img> tag is empty, it contains attributes only, and does not have
a closing tag.
The <img> tag has two required attributes :
1. src : Specifies the path to the image.
2. alt : Specifies an alternate text for the image.
HTML Images cont.
• The required src attribute specifies the path
(URL) to the image.
• The required alt attribute an alternate text for
an image.
• If the user cannot view it (because of slow
connection, an error in the src attribute
• The value of the alt attribute should describe
the image.
HTML Video
• The HTML <video> element is used to show
a video on a web page.
• The controls attribute adds video controls,
like play, pause, and volume.
• Width attribute to set the size of the video.
• The <source> element allows you to
specify video files.
HTML Audio
• The HTML <audio> element is used to play an audio file on a web page.
• The controls attribute adds audio controls, like play, pause, and volume.
• The <source> element allows you to specify audio files.
HTML Iframes
• 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.
• The src attribute defines the URL of the page to embed.
• Always include a title attribute (for screen readers).
• The height and width attributes specify the size of the iframe.
Home work
Watch this video to make this Web page
: