Friday, 22 June 2018

Chaudhari Karan

HTML – Text Links

    No comments:


HTML – Text Links

Hello friends, In this lecture, we will discuss HTML Text Links.
HTML – Text Links


A webpage has various links which take directly to other web pages and specific parts of a webpage. These links are called the hyperlinks.

Hyperlinks are navigating websites by clicking on words, phrases, and images. Thus can create hyperlinks using text or images available on a webpage.

Linking Documents

A link is created by using HTML a tag. This tag is known as anchor tag and anything between the opening tag and the closing tag is part of the link and a user can click that part to reach that linked document.

Example

Here is the example which links https://www.alwaysspot.com/

HTML Linking Documents


Output
HTML Linking Documents

The target Attribute

The target attribute we used in our previous example. The attribute specifies the location where open the linked document.

Option
                                                        Description
_blank
Open the link in new tab or window.
_self
Open the link in same tab or window.
_top
Open the link in full body of the window.
_parent
Open the link in the parent frame.
Target frame
Open the link in the named target frame.

Example

HTML target Attribute


Output
HTML target Attribute



Use of Base Path

The base path is used for link HTML documents related to the same website. For the base, a path used the base tag. It is not required to give a complete URL for every link. So browser will concatenate given relative path to this base path and will make a URL.

Example

HTML Use of Base Path


Output
HTML Use of Base Path

When clicking on the link generated HTML Tutorial to reach to the HTML tutorial.




Linking to a Page Section

Create the link to a particular section of a webpage by using name attribute. It is a two-step process.

Note − The name attribute deprecated in HTML5. Don't use this attribute. Use id and title attribute instead.

First, create the link to the place to reach within a webpage and name it using a… tag as follows −

HTML  Linking to a Page Section


Second is to create a hyperlink to link the document and place to reach –

HTML  Linking to a Page Section

Setting Link Colors

For set colors of links, active links and visited links using link, alink and vlink attributes of the body tag.

Example

HTML Setting Link Colors

Output
HTML Setting Link Colors

Download Links

Create text link to make PDF, or DOC or ZIP files downloadable. First, create complete URL of the downloadable file as follows −

Example

HTML Download Links

 Output

HTML Download Links

Subscribe to this Blog via Email :