After we have finished reading any page we have to scroll way up and up to go to the top. To go to the top either we have to use mouse or we can use anchor tag (Much easier way!!!). Scrolling mouse will be slow and hard to do every time hence we can create an anchor tag which will be effective method. So how to create an anchor tags which will lead us to top of a web page. Well it’s easy. You just need to put some code in HTML and voila it’s done.
What is an Anchor Tag?
An anchor tag is an HTML tag. Anchor tag is used to begin and end of a hyper link. The <a> tag is defined as hyperlink which can be used to link from one page to another. It might be menu link or table of contents or links which can take you to another page altogether. The most used attribute of <a> element is href attribute which normally are linked to another page. User clicks on the anchor text to reach to the target link.
Dos and Don’ts of anchor link
-Understand the click-ability of the users
-use words like “Top” or “Top of the page” or an arrow key and make it right aligned
-make sure the anchor ink is visible and not mixed up with other text
-Too many of anchor link
-1st sub heading and then immediately anchor link
-when the anchor link is merged with other link which will look messy
Benefits of anchor tag
-If a reader wants to read a particular section they can directly go to that page or section instead of scrolling again and again.
-save their time
-the page looks organized this way
So let’s follow the steps below to do it.
Write down this HTML code where you want to place it normally it placed in opening <Body> tag usually found below the </head> tag. Just after <Body> tag where its opens you can add the below code.
This code will create and anchor point to page and name it above.
Now you can go to the bottom of the page or where you want to put the text by using anchor id and paste the below code.
<a href=”#above”>Back to top of page</a>
Viola it’s done.Now click on this link to go to the Top of the page
This is anchor tag which is used in most of the website. Many website understand #above tag value even if <a> tags are not used. But it is still advisable to use anchor tag which needs to be defined in the page. Also anchor links are also helpful with SEO as Google may show them below their search listings for easy navigation.