If you take this example, <a name="xxx"></a>
... is this ok when creating an anchor?
I have always preferred to use an already created tag for my destinations.
views:
96answers:
4For navigational purposes within one page, it's perfectly fine. Though that style of navigation is usually related to some kind of headings or titles, so usually most people end up surrounding the appropriate heading/title with the anchor. I guess it's better from a readability and maintenance point of view.
Of course, why not? You just create internal link to content block with this method.
If you are using this for in page navigation you can just just the id of the element rather than having to set up the anchor tag e.g.
<a href="#stuff">link to stuff</a>
<div id="stuff"></div>
I personally would not use an empty anchor tag.
Using an anchor tag without href is useless. It is simply put a text styling to the contents inside the tag. But you can use a anchor tag without a href, But onthe onclcick event you can dynamically divert the navigation of page. We use simply in some sites to apply the style to the contents within the anchor tag.