MARCELO 0 Posted April 1, 2018 Report Share Posted April 1, 2018 Is it possible to transform a scroll to the top button into a scroll down, starting from this code: https://www.w3schools.com/code/tryit.asp?filename=FPWUJPO1D0PN I tried to make some changes, but its really far from being the way i wanted it to be, Thanks, Quote Link to post Share on other sites
Ingolme 1,020 Posted April 1, 2018 Report Share Posted April 1, 2018 Put an element with an id attribute on the page at the point where you want the browser to scroll to. <div id="destination">Destination</div> Then put a link that goes to that element: <a href="#destination">Go to destination</a> Quote Link to post Share on other sites
MARCELO 0 Posted April 9, 2018 Author Report Share Posted April 9, 2018 Ok. I tried to style the link, but i can t take it to middle. https://www.w3schools.com/code/tryit.asp?filename=FQ7Q9YP9CY0X Thanks. Quote Link to post Share on other sites
dsonesuk 913 Posted April 9, 2018 Report Share Posted April 9, 2018 Getting nothing but blank html code? Quote Link to post Share on other sites
MARCELO 0 Posted April 9, 2018 Author Report Share Posted April 9, 2018 sorry? Quote Link to post Share on other sites
dsonesuk 913 Posted April 9, 2018 Report Share Posted April 9, 2018 (edited) To centre text and inline elements <a>..</a>, it must be within a block element paragraph <p>...</p>, or <div>...</div> , and that block element must use text-align: center; OR turn inline element '<a>' then use 'text-align: center;' on that. but note the link will stretch from left to right, unless you give it a specific fixed width, and use margin: 0 auto; https://www.w3schools.com/code/tryit.asp?filename=FQ7TVLU3G4O9 Edited April 9, 2018 by dsonesuk Quote Link to post Share on other sites
dsonesuk 913 Posted April 10, 2018 Report Share Posted April 10, 2018 9 hours ago, dsonesuk said: OR turn inline element '<a>' then use 'text-align: center;' on that OR turn inline element '<a>‘ into block element, using display: block; then... Quote Link to post Share on other sites
MARCELO 0 Posted April 11, 2018 Author Report Share Posted April 11, 2018 Instead of putting an element with an id attribute on the page at the point where i EXACTLY want the browser to scroll to, can i specify a distance from this point - up or down - to the browser scroll to? Quote Link to post Share on other sites
dsonesuk 913 Posted April 11, 2018 Report Share Posted April 11, 2018 To specify a distance, you'll have calculate the distance to specific a point, which is usually done to an element with a specific id, then by using JavaScript .scrollTop, so either way you will require and element with id attribute. Quote Link to post Share on other sites
MARCELO 0 Posted April 12, 2018 Author Report Share Posted April 12, 2018 Ok, thanks! In the first case, considering the exactly point, how can i add a slide effect, like this: http://garbiadv.com/#areas_de_atuacao i tried to search for it here in W3 and even in the templates there isn t this effect. Thanks again. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.