Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link to an element within the current page [closed]

Tags:

html

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> 
like image 954
romi Avatar asked Sep 12 '12 10:09

romi


People also ask

How do I link to an element on the same page?

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.

Which tag links to a section within the current page?

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.

Can you link to a specific part of a web page?

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.

How do I stay in the same page after clicking links?

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.


1 Answers

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>.

like image 108
Neil Avatar answered Sep 19 '22 18:09

Neil