I want to create a div
, which the width
and height
are exactly equal to height of 1 character, and the width as well as height should be responsive: if I change the font size, the width and height would also change. I tried :
<table border="1" style="position:relative;">
<tr>
<td style="font-size:144px"> 
<div style="position:absolute;top:0%;left:0%;background-color:red;width:100%;padding-bottom:100%;"/>
</td>
</tr>
</table>
which the side of red square equals to width
of " " automaticlly. But I want it be equal to height
of " ", I tried:
<table border="1" style="position:relative;">
<tr>
<td style="font-size:144px"> 
<div style="position:absolute;top:0%;left:0%;background-color:red;height:100%;padding-right:100%;"></div>
</td>
</tr>
</table>
which just replace "width" with "height" and "padding-bottom" with "padding-right",but seems not working, is there any way to do this?