简体   繁体   中英

PHP Redirect to an anchor tag

I want to navigate from another page to the bottom of the home page.

Where section that I want to navigate to on the home page is defined by:

<div name="about" id="about" class="about-us">

Everywhere I read it says all you have to do to link to this page and this location is say:

<a href="/public_html/index.php#about">Link to bottom of home page.</a>

However, it does not work. There has got to be something simple that I am over looking.

EDIT:

Whenever I click the link, the browser does nothing, like it is not a link.

Take this example:

I am on the homepage, I click a link to #about, it scrolls down to #about, no problem.

I am on a page that is not the home page. I click on a link to #about, the browser does nothing, does not even take me back to the home page.

The code in your example will work just fine, so something else is probably preventing the jump. For example, if you have a form on the page that has auto focus.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM