Create pyramid in css and html

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.shape {
  margin: auto;
}

#top {
  width: 0;
  height: 0;
  border-left: 50px solid transparent;
  border-right: 50px solid transparent;
  border-bottom: 60px solid red;
}

#top:hover {
  border-bottom: 60px solid yellow;
}

#center {
  border-bottom: 75px solid blue;
  border-left: 60px solid transparent;
  border-right: 60px solid transparent;
  height: 0;
  width: 100px;
}

#center:hover {
  border-bottom: 75px solid pink;
}

#bottom {
  border-bottom: 100px solid green;
  border-left: 80px solid transparent;
  border-right: 80px solid transparent;
  height: 0;
  width: 220px;
}

#bottom:hover {
  border-bottom: 100px solid purple;
}
</style>
</head>
<body>
<body>
  <div class="shape" id="top"></div>
  <div class="shape" id="center"></div>
  <div class="shape" id="bottom"></div>
</body>
</body>
</html>

Comments

Popular posts from this blog

Shutdown Computer With Funny Reason

Hidden Attribute in javascript

Draw animated loading spinner canvas in Javascript