triangle by CSS border

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

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

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

  
</head>

<body>

  <div class='tri'></div>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/HelloLeeChan/triangle-by-css-border-NbLWmN */
.tri {
  position:absolute;
  box-sizing:border-box;
  width:100px;
  height:100px;
  border-bottom:50px transparent solid;
  border-left:50px blue solid;
  border-top:50px transparent solid;
  background-color:transparent;
}

Comments