Scroll to a div with <a> anchor target - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:a

Description

Scroll to a div with <a> anchor target

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
 </head> <!--from  w w  w.  ja v  a  2  s .  c o m-->
 <body> 
  <a href="#div1">Go to div one</a> 
  <div style="height: 1000px; background-color:#ccc;"></div> 
  <div id="div1">
    Div 1 Content 
  </div>  
 </body>
</html>

Related Tutorials