-1

I have div element with height and width. Inside div element, I have a font icon. I would like to make it stretch to full height and width of div element.

Here is a link to show what I have tried.

Exception
  • 8,111
  • 22
  • 85
  • 136

2 Answers2

2

The only way I can think of to do this would be to surround the text in it's own element and use a CSS transform, but it requires very particular sizing and would need to be experimented with for every icon and situation. I don't believe font-stretching is supported in any browser.

<div class="fa element"><span>&#xf09d;</span></div>

.element span {
  line-height: 0.2;
  display: inline-block;
  transform: scale(1.86,1.15);
  transform-origin: 0 0;
}

Updated bin: http://jsbin.com/mecodanovo/1/edit?html,css,js,output

jeffjenx
  • 17,041
  • 6
  • 57
  • 99
1

Bit of a horrible answer but it's the only way I can think of doing it. You'd need to add a container and then use the scale transform

.container {
  -ms-transform: scale(1.87, 1.16);
    -webkit-transform: scale(1.87, 1.16);
    transform: scale(1.87, 1.16);
    margin-left: 91px;
    margin-top: 2px;
}

full method below

http://jsbin.com/fiqixudamo/1/edit?html,css,js,output

RouthMedia
  • 401
  • 1
  • 4
  • 17