Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

in HTML, url contains #, scroll page to header?

If my url is something like: http://www.thisisawebsite.com/page.php#about
How do i make it so when the link is clicked, it'll go to the header "about", or anywhere else i so desire?

like image 502
phxvyper Avatar asked Oct 23 '12 22:10

phxvyper


1 Answers

Just markup the header on the target page with the id "about" i.e.

About

That way your link on the linking page http://www.thisisawebsite.com/page.php#about will go straight to the "about" header - a h1 in this example but it could be whatever you'd given the id of "about". Remember you should only use the id "about" once on the page though.

like image 175
Richard Jordan Avatar answered Nov 14 '22 18:11

Richard Jordan