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….

<?php
    require "requires/top.php";
    require "requires/nav.php";
    require "main/landed.php";
    require "main/about.php";
    require "main/galleries.php";
    require "main/contact.php";
    require "requires/footer.php";
?>


<script type="text/javascript" src="js/jquery-3.2.0.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/wow.min.js"></script>
<script type="text/javascript"> new WOW().init(); </script>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript" src="js/instafeed.min.js"></script>
<script type="text/javascript" src="js/magic.js"></script>
<script type="text/javascript" src="js/contest.js"></script>
<script type="text/javascript" src="js/feed.js"></script>
<script type="text/javascript" src="js/feed2.js"></script>
<script type="text/javascript" src="js/gal-switch.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.form/4.2.1/jquery.form.js"></script>

Advertisement

Answer

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

<div id="first-name-group" class="form-group">
    <input type="text" name="txtFirstName" class="form-control" placeholder="First Name" id="firstName" autofocus>
</div>

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