Se si lavora con pagine o articoli di una certa lunghezza, capita spesso di avere la necessità di creare link interni.
Utilizzando il linguaggio HTML questo tipo di comportamento può essere realizzato utilizzando:
1 |
<span style="font-style: inherit; color: #009900;"><<span style="font-weight: bold; font-style: inherit; color: #000000;">a</span> <span style="font-style: inherit; color: #000066;">name</span><span style="font-style: inherit; color: #66cc66;">=</span><span style="font-style: inherit; color: #ff0000;">"nome-elemento"</span>><<span style="font-style: inherit; color: #66cc66;">/</span><span style="font-weight: bold; font-style: inherit; color: #000000;">a</span>></span> |
ad indicare il punto del testo a cui un particolare link dovrà puntare.
Ed utilizzando un link con la seguente sintassi:
1 |
<span style="font-style: inherit; color: #009900;"><<span style="font-weight: bold; font-style: inherit; color: #000000;">a</span> <span style="font-style: inherit; color: #000066;">href</span><span style="font-style: inherit; color: #66cc66;">=</span><span style="font-style: inherit; color: #ff0000;">"#nome-elemento"</span>></span>Clicca qui per andare all'àncora<span style="font-style: inherit; color: #009900;"><<span style="font-style: inherit; color: #66cc66;">/</span><span style="font-weight: bold; font-style: inherit; color: #000000;">a</span>></span> |
per creare il link iniziale.
All’interno delle pagine/articoli in WordPress si può ottenere lo stesso risultato, impostando il parametro id per l’elemento destinazione.
1 |
<span style="font-style: inherit; color: #009900;"><</span><span style="font-style: inherit; color: #009900;"><span style="color: #000000;"><b>h2 id="nome-elemento"</b></span><span style="color: #009900;">>Testo a cui puntare<</span><span style="font-style: inherit; color: #66cc66;">/h2</span><span style="color: #009900;">></span></span> |
1 |
<span style="font-style: inherit; color: #009900;"><<span style="font-weight: bold; font-style: inherit; color: #000000;">a</span> <span style="font-style: inherit; color: #000066;">href</span><span style="font-style: inherit; color: #66cc66;">=</span><span style="font-style: inherit; color: #ff0000;">"#nome-elemento"</span>></span>Clicca qui per andare all'àncora<span style="font-style: inherit; color: #009900;"><<span style="font-style: inherit; color: #66cc66;">/</span><span style="font-weight: bold; font-style: inherit; color: #000000;">a</span>></span> |