How to go to a part of a text on the same page by clicking on a link above

3

Imagine a page with lots of text. What I want to do is make a clickable word that when the user clicks it goes to another text on the same page.

I want to do this using XHTML and CSS.

I have at least one idea that XHTML is used # but I can not remember how it's done.

    
asked by anonymous 21.07.2014 / 14:29

3 answers

3

It's called anchor link

Example with div:

<div id="tips">Useful Tips Section</div> <!-- crie um ID para a div ou span -->

Or with another link:

<div id="tips">Useful Tips Section</div>

Calling another link to the position of the previous div or link:

<a href="#tips">Visit the Useful Tips Section</a> <!-- Utilize esta Id com # no link para ir até este local -->

Calling the link on another page:

<a href="http://www.w3schools.com/html_links.htm#tips">Visit the Useful Tips Section</a>

Here you need to pass the complete url of the site, because you are using it in another location, another site, etc., but it works, it will point exactly to div id = "tips"

Source: link

    
21.07.2014 / 14:34
5
<section id ="top">Texto</section>

<a href="#top">Clique aqui</a>

The link goes to the section.

    
21.07.2014 / 14:32
4

Just by using section to place the text you want to link and put a id in this section :

<section id="minhaTag">
    <!-- o meu texto -->
</section>

Then just use this id in the reference word for the text:

<a href="#minhaTag">Palavra de link para o texto</a>
    
21.07.2014 / 14:34