Sunday, February 8, 2015

HTML5 CSS3 Triangle | HTML 5 & CSS 3 - Create a Triangle

CSS 3 Triangle Code


The code below creates a black triangle

<style>
.triangle {
 width: 0;
 height: 0;
 border-left: 50px solid transparent;
 border-right: 50px solid transparent;
 border-bottom: 100px solid black;
}
</style>
<div class="triangle"></div>


CSS3 Add Border Color

If we give the borders a color, what will happen?
<style>
.triangle2 {
 width: 0;
 height: 0;
 border-left: 50px solid red;
 border-right: 50px solid blue;
 border-bottom: 100px solid black;
}
</style>
<div class="triangle2"></div>



Create a Successful Online Store at Bigcommerce! Try it Free Now!

No comments:

Post a Comment