CSS Routing

In this example below you will see how to do a CSS Routing with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by clarkhacks, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright clarkhacks ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>CSS Routing</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <a href="#a">a</a>
<a href="#b">b</a>
<a href="#c">c</a>

<div id="a" class="page"> this is a id</div>
<div id="b" class="page"> this is b id</div>
<div id="c" class="page"> this is c id</div>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/clarkhacks/css-routing-jxRmEE */
#a, #b, #c{
	display:none;
}
#a:target{
	display:block;
}
#b:target{
	display:block;
}
#c:target{
	display:block;
}

Comments