
Originally Posted by
AnGeLiC
For the links at the top of the page:
HTML Code:
<p>
<a href="#music">Featured Music.</a>
</p>
What you're referring to here is a source anchor; one anchor in a pair that points from one location (the source) to another (the destination). That destination can either be found in the same document, or a different one. As you've discovered, a fragment identifier (#fragment-id) designates a particular location within a document.
Put this where you want that link to jump to on the page:
HTML Code:
<a name="music">*content*</a>
This is the destination anchor, and there are in fact two ways to specify one. An anchor (a) element with a name attribute acts as a destination anchor, where the value of that attribute would match against the fragment identifier. This, however, is an increasingly less common approach. In its place, one can add an id attribute directly to the destination element, which adds a lot more flexibility. For example, the above could be replaced with
HTML Code:
<p id="music">*content*</p>
Mike
To include markup, it's best to use [html]...[/html] rather than [quote]...[/quote]. The former retains formatting, which can greatly aid readability for large sections of code. There are similar tags for miscellaneous code like CSS or scripts ([code]...[/code]
and PHP code ([php]...[/php]
.
Bookmarks