I want to change not the font-size
of a text element, but two independent properties relative to its width and height.
For instance, by applying font-width: 50%
to this element:
the text would be stretched to half:
Is this possible with CSS?
CSS transform
has the scale
function for this:
p {
display: inline-block;
font-size: 32px;
transform: scale(.5, 1);
}
<p>This is text.</p>
Use the two numbers in the function for X- and Y-axis respectively.