Page Stats
Visitor: 677
CSS3 Shapes
Using css properties we can create many different types of shapes. Few examples of shapes are mentioned below:
Left Triangle
<style>
.div1{
width: 0px;
height: 0px;
border-left: 100px solid green;
border-top: 60px solid transparent;
border-bottom: 60px solid transparent;
}
</style>
Right Triangle
<style>
.div1{
width:0px;
height:0px;
border-right:100px solid green;
border-top:60px solid transparent;
border-bottom:60px solid transparent;
}
</style>
Top Triangle
<style>
.div1{
width:0px;
height:0px;
border-left:60px solid transparent;
border-right:60px solid transparent;
border-top:100px solid green;
}
</style>
Bottom Triangle
<style>
.div1{
width:0px;
height:0px;
border-left:60px solid transparent;
border-right:60px solid transparent;
border-bottom:100px solid green;
}
</style>
Top Left Triangle
<style>
.div1{
width:0px;
height:0px;
border-left:100px solid green;
border-bottom:100px solid transparent;
}
</style>
Top Right Triangle
<style>
.div1{
width:0px;
height:0px;
border-right:100px solid green;
border-bottom:100px solid transparent;
}
</style>
Bottom Left Triangle
Example 7: Bottom Left Triangle
<style>
.div1{
width:0px;
height:0px;
border-right:100px solid transparent;
border-bottom:100px solid green;
}
</style>
Bottom Right Triangle
Example 8: Bottom Right Triangle
<style>
.div1{
width:0px;
height:0px;
border-left:100px solid transparent;
border-bottom:100px solid green;
}
</style>
CSS Diamond Shape
div{
width: 200px;
height: 200px;
border: 5px solid #f99;
transform: translateY(60px) rotate(45deg);
margin: auto;
background: #fee;
}
CSS Octagon Shape
CSS Loader
div{
width: 200px;
height: 200px;
border: 15px solid #ffb0ad;
border-top: 15px solid transparent;
border-bottom: 15px solid transparent;
margin: auto;
border-radius: 50%;
}