I recently tried out a div with a different shape, like a trapezoid of a triangle, etc.
HTML:
<div class="triangle">HI nice to meet you guys</div>
CSS
.triangle {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid blue;
}
Previously, content was displayed correctly when the div is a square (height and width 100 pixels).
When I create a div so that it looks like a triangle, then the contents materialize.
How can I make it proportional so that it displays correctly inside the div.
See the script: http://jsfiddle.net/7qbGX/2/
Any suggestion would be great.
source
share