Skip to content
Advertisement

Page not loading at the top

I have a single page website. When I visit the domain of the site, it starts me off half way down the page. I’m not sure what’s causing this. Has anyone experienced this before? I can provide the link to the site if necessary.

My index.php page….

JavaScript

Advertisement

Answer

Your page scrolls down because it centers the “First Name” input in the contact section because it has the autofocus attribute.

JavaScript

Just remove the autofocus attribute.

If you want to learn more I recommend to read the MDN Web Documentation.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement