I want to stretch text (like ms-word) using CSS or some other possible technique.
Following CSS is not actually stretching anything:
font-stretch:ultra-expanded;
Please redirect me if I am wrong.
Thank you in advance.
I want to stretch text (like ms-word) using CSS or some other possible technique.
Following CSS is not actually stretching anything:
font-stretch:ultra-expanded;
Please redirect me if I am wrong.
Thank you in advance.
You can use CSS Transforms, like
h2 {
width: 50%;
margin: auto;
transform: scaleX(2);
}
<h2>Stretched text</h2>
But usually distorting fonts is not a good idea. Probably it's better to look for a web font that initially looks as you need.
font-stretch
(characters itself) can be achieved by css3's transform:scaleX() and transform:scaleY() properties in which dimension you want to stretch.
Here is cross browsers compatible CSS:
-webkit-transform:scaleX(2);
-moz-transform:scaleX(2);
-ms-transform:scaleX(2);
-o-transform:scaleX(2);
transform:scaleX(2);
Some of the options in CSS:
.broader {
letter-spacing:0.5em;
word-spacing:1.5em;
text-align: justify;/* Fills to parents borders */
}
font-stretch
isn’t supported by others than IE+FireFox ... look here: http://caniuse.com/#search=font-stretch
Besides font-stretch
won’t actually make any font wider, it will just substitute current font with a wider variant ... kinda like font-style:bold/italic
does.