HTML Links - Hyperlinks
Local Links.
HTML Links - Colors
HTML Links - The target Attribute
HTML Links - Image as Link
HTML Links - Create a Bookmark
Chapter Summary
HTML links are hyperlinks.
A hyperlink is a text or an image you can click on, and jump to another document.
HTML Links - SyntaxA hyperlink is a text or an image you can click on, and jump to another document.
In HTML, links are defined with the <a> tag:
<a href="url">link text</a>
The example above used an absolute URL (A full web address).
A local link (link to the same web site) is specified with a relative URL (without http://www....).
A local link (link to the same web site) is specified with a relative URL (without http://www....).
<a href="html_images.asp">HTML Images</a>
When you move the mouse over a link, two things will normally happen:
The mouse arrow will turn into a little hand
The color of the link element will change
By default, a link will appear like this (in all browsers):
An unvisited link is underlined and blue
A visited link is underlined and purple
An active link is underlined and red
You can change the default colors, by using styles:
The mouse arrow will turn into a little hand
The color of the link element will change
By default, a link will appear like this (in all browsers):
An unvisited link is underlined and blue
A visited link is underlined and purple
An active link is underlined and red
You can change the default colors, by using styles:
<style>
a:link {color:green; background-color:transparent; text-decoration:none}
a:visited {color:pink; background-color:transparent; text-decoration:none}
a:hover {color:red; background-color:transparent; text-decoration:underline}
a:active {color:yellow; background-color:transparent; text-decoration:underline}
</style>
a:link {color:green; background-color:transparent; text-decoration:none}
a:visited {color:pink; background-color:transparent; text-decoration:none}
a:hover {color:red; background-color:transparent; text-decoration:underline}
a:active {color:yellow; background-color:transparent; text-decoration:underline}
</style>
The target attribute specifies where to open the linked document.
This example will open the linked document in a new browser window or in a new tab:
This example will open the linked document in a new browser window or in a new tab:
<a href="http://www.Schoolatnet.blogspot.com/" target="_blank">Visit schoolatnet!</a>
It is common to use images as links:
<a href="default.asp">
<img src="smiley.gif" alt="HTML tutorial" style="width:42px;height:42px;border:0">
</a>
<img src="smiley.gif" alt="HTML tutorial" style="width:42px;height:42px;border:0">
</a>
HTML bookmarks are used to allow readers to jump to specific parts of a Web page.
Bookmarks are practical if your website has long pages.
To make a bookmark, you must first create the bookmark, and then add a link to it.
When the link is clicked, the page will scroll to the location with the bookmark.
Bookmarks are practical if your website has long pages.
To make a bookmark, you must first create the bookmark, and then add a link to it.
When the link is clicked, the page will scroll to the location with the bookmark.
<h2 id="tips">Useful Tips Section</h2>
Use the HTML <a> element to define a link
Use the HTML href attribute to define the link address
Use the HTML target attribute to define where to open the linked document
Use the HTML <img> element (inside <a>) to use an image as a link
Use the HTML id attribute (id="value") to define bookmarks in a page
Use the HTML href attribute (href="#value") to link to the bookmark
HTML Link Tags.Use the HTML href attribute to define the link address
Use the HTML target attribute to define where to open the linked document
Use the HTML <img> element (inside <a>) to use an image as a link
Use the HTML id attribute (id="value") to define bookmarks in a page
Use the HTML href attribute (href="#value") to link to the bookmark
<a> Defines a hyperlink
0 comments:
Post a Comment