11

I am required to stretch text horizontally, but the only thing I could find was font-stretch which, according to w3schools, isn't supported by any browser.

Is there any other way which I can meet this effect?

dsgriffin
  • 66,495
  • 17
  • 137
  • 137
JBrookes
  • 135
  • 1
  • 2
  • 8
  • possible duplicate of [Css, Can I stretch text?](http://stackoverflow.com/questions/6351013/css-can-i-stretch-text) – web-tiki Jul 04 '14 at 07:49

2 Answers2

21

Yes - you can achieve this by using CSS 2D transforms.

Here's a working JSFiddle.

Note that the example in the Fiddle/code below is for Chrome/Safari (WebKit), however, you can use 2D transforms in all major browsers by using the -moz-, -o-, and ms equivalent prefixes/methods!

HTML:

<span>Hello!</span>

CSS:

span {    
  transform:scale(3,1); 
  -webkit-transform:scale(3,1);
  display:inline-block; 
}

Support:

It is supported in Chrome, Firefox, IE9+ and Opera browsers.

TylerH
  • 20,799
  • 66
  • 75
  • 101
dsgriffin
  • 66,495
  • 17
  • 137
  • 137
0

Do you mean this? With CSS:

text-align: justify
Andrea Turri
  • 6,480
  • 7
  • 37
  • 63