Web DevelopmentHTML Auto Focus

HTML Auto Focus

If you have a very long page with lots of contents, the user has to scroll up and down to reach a point in the page that can be annoying. It would be nice to place headings on the top of your page and when the user clicks on them he is taken to that part of the page without having to scroll. Best example can be seen in Wikipedia – you click a topic on top and it automatically scrolls the page and locates the content. Here is how you can do it

Example
Say you have two food items(Pizza and Burger) and you want to achieve this feature. So on top of your page you will place the below 2 links

<a href="#Pizza">Go to Pizza</a>
<a href="#Burger">GO to Burger</a>
some html content or pics or whatever. ... . . .

<a name="Pizza"></a>Content related to Pizza
Everything about Pizza goes here
some html content or pics or whatever. ... . . .
 
<a name="Burger"></a>Content related to Burger
Everything about Pizza goes here 
some html content or pics or whatever. ... . . .

Categories: Web Development

Comments

No Comments Yet. Be the first?

Post a comment

Your email address will not be published. Required fields are marked *