Do you know HTML elements can be converted into different shapes i.e. Square Shape, Rectangular Shape, Circle Shape, etc?
To create a square shape we just need to set the same value of CSS width and height property on HTML Block Elements.
<style>
.square{
width:100px;
height:100px
}
</style>
<head>
<style>
.square{
background-color:black;
width:100px;
height:100px;
color:white;
}
</style>
</head>
<body>
<div class="square">Square</div>
</body>
To create a Rectangle Shape we can set different values of CSS width and height property on HTML Block Elements.
<style>
.square{
width:180px;
height:100px
}
</style>
<head>
<style>
.rect{
background-color:black;
width:200px;
height:100px;
color:white;
}
</style>
</head>
<body>
<div class="rect">Rectangle</div>
</body>
Here is an example of a Triangle using CSS properties.
<style>
.triangle1{width:0;height:0;border-left:100px solid transparent;
border-bottom:100px solid red}
.triangle2{width:0;height:0;border-left:100px solid transparent;
border-top:100px solid red}
</style>
<head>
<!--style sheet-->
<style>
.triangle1
{
width:0;
height:0;
border-left:100px solid transparent;
border-bottom:100px solid red
}
</style>
</head>
<!--Body-->
<body>
<div class="triangle1">
</div>
</body>
We can use CSS3 border-radius property to create circles.
<style>
.circle{
width:100px;
height:100px;
border-radius:50%;
background-color:red;
}
</style>
<head>
<style>
.circle{width:100px;
height:100px;
border-radius:50%;
background-color:red;
}
</style>
</head>
<body>
<div class="circle">
</div>
</body>
We can use the CSS3 skew function to create a parallelogram.
<style>
.tdb-parallo{
width:100px;
height:70px;
transform:skew(25deg);
margin-left:20px;
background-color:red;
}
</style>
<head>
<style>
.tdb-parallo{width:100px;
width:100px;
height:70px;
transform:skew(25deg);
margin-left:20px;
background-color:red;
}
</style>
</head>
<body>
<div class="tdb-parallo">
</div>
</body>