"name" attribute in anchor tag
When using named anchors, you can create links to a specific section on a page, instead of letting your viewer scroll around to see what he/she is looking for.
Example:
In file1.html we have:
<a name="css-tutorials">Go to Home</a>
In file2.html we have:
<a href="file1.html#css-tutorials">Go to CSS Tutorials</a>
Just place the # sign followed by the name attribute value for the file1.html's anchor tag.
I have created an anchor tag whose name attribute = "top".
The above line specifies a named anchor ,ie., the anchor will be accessed by # sign and the anme attribute's value.
Now we have a long paragraph such that the top anchor is not visible when we are scrolling down to the end of the web page. So, the user needs a mechanism to go the top of the page on one click without scrolling or using the scroll bar ,we write a hyperlink with the #top href attribute.
When the user clicks on the anchor, the screen will automatically scroll up to the top of the page
Comments
Post a Comment