Aoi Posted December 1, 2020 Share Posted December 1, 2020 I am trying to be able to click the "About me" and have the gif go to the center of the page instead of taking you to a new page <div class="w3-col s4"> <h4>About</h4> <p><a href="https://www.linkpicture.com/q/unnamed_10.gif"><class="w3-bar-item w3-button w3-padding" onclick="document.getElementById('newsletter').style.display='block'">About us</a></p> <p><a href="#">Shipping</a></p> <p><a href="#">Payment</a></p> </div> Link to comment Share on other sites More sharing options...
niche Posted December 3, 2020 Share Posted December 3, 2020 https://www.w3schools.com/css/css_align.asp Link to comment Share on other sites More sharing options...
dsonesuk Posted December 5, 2020 Share Posted December 5, 2020 (edited) Then don't use anchor link to that image, that will always open a new page before anything else, open a bookmark link to that id element with that img src to that same url <a href="#newsletter">About us</a> <div id="newsletter"><img src="https://www.linkpicture.com/q/unnamed_10.gif"></div> https://www.w3schools.com/code/tryit.asp?filename=GLDM0XJCEEVD Edited December 5, 2020 by dsonesuk Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now