Recently, I experimented with creating div elements in different shapes such as triangles and trapezoids.
HTML:
<div class="triangle">Hello! Nice to meet you all.</div>
CSS
.triangle {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid blue;
}
The content displayed correctly when the div was a square (with both height and width set to 100px).
However, after styling the div to appear as a triangle, the content began to overflow.
I am seeking advice on how to maintain proportionality so that the content displays properly within the div element.
View the fiddle here: http://jsfiddle.net/7qbGX/2/
Any suggestions or guidance would be greatly appreciated.