Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Der Titel des Dokuments</title> <style> html { scroll-behavior: smooth; } #element1 { height: 600px; background-color: #ccc; } #element2 { height: 600px; background-color: #8ebf42; } </style> </head> <body> <h2>Beispiel für die Eigenschaft scroll-behavior</h2> <div class="main" id="element1"> <h2>Element 1</h2> <a href="#element2">Klicken Sie hier, um das Element 2 zu scrollen.</a> </div> <div class="main" id="element2"> <h2>Element 2</h2> <a href="#element1">Klicken Sie hier, um das Element 1 zu scrollen.</a> </div> </body> </html>