How To Scroll Down The Page To View A Div In A Link Clicked
In my html page, there exists a link to sign up and a div which holds the signup form.
Solution 1:
To use just HTML
, you can use an anchor tag.
<div><a id='form'></a>
<form method="POST" action="signup.php">
...
</div>
Then your link will be the following: <a href="#form">Click here to sign up</a>
Explanation: That link goes to the a
anchor tag with the id
of form
.
Solution 2:
Use the following,
<a href="index.html"><img src="images/logo2.png" alt="LOGO"></a>
<a href="#test">Sign Up</a>
<div id="test">
<form method="POST" action="signup.php"> ... </form>
</div>
Solution 3:
By using simple HTML,using anchor tag you can scroll page to your SignUp div. "#" in href is used to redirect within the page. Hope this helps
<a href="#mySignUpDiv">Sign Up</a>
<div id="mySignUpDiv">
</div>
Post a Comment for "How To Scroll Down The Page To View A Div In A Link Clicked"