I created a HTML page with a number of tables with headers like this: Content, Main_Page, Document, Expenses, etc.
I want to create a link for the top of the page. When I click that link it should go to the specific section. So I use the below code to map the content. But it's not working for me.
<a href="#Content">Content Section</a>
Linking to an element on the same page Note: You can use href="#top" or the empty fragment ( href="#" ) to link to the top of the current page, as defined in the HTML specification.
A link (or hyperlink as it is also called) is created with a special <a> tag called an "anchor". It requires a closing tag and is used to delineate the text or HTML content that should be linked on the page. An <a> tag can also be used to mark a section of a web page as a target for another link to jump to.
Select a portion of the text on the webpage, right-click and click on “Copy Link to Selected Text”. It will generate a link and automatically copy it on the clipboard.
usually href's ar used to transfer the request to another page.. If you want to redirect another page still the existing page remain open use target attribute.. If you dont want to redirect anywhere and still want send a signal while clicking the text, use onclick on the text and not the href.
You need to create an anchor for the link. The modern way of doing this is to give the appropriate element an id="Content"
attribute. The older way of doing this was to use <a name="Content"></a>
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With