davatron5000 / FitText.js

A jQuery plugin for inflating web type
http://fittextjs.com
6.76k stars 1.39k forks source link

div width issue when using any other than display:block #47

Closed chrisid closed 10 years ago

chrisid commented 11 years ago

First of all this is really a great piece of code, thanks for sharing!

I've been trying to retain the div width to the text width, inline-block fix that, but then the fit stops working, any tricks on how to fix this?

I need to constrain the mouse clickable area to text only and not to the over-width (pink area on first 3 lines) area.

http://jsfiddle.net/christianpugliese/t8f2y/1/

TA.

davatron5000 commented 10 years ago

Hopefully you figured this out by now but I thought I'd respond (late) anyways.

FitText requires a width for it to calculate on. display-block has an inherent width: 100%, while display: inline and display: inline-block have an inherent width of 0.

We're working on ways to make that clear that up or automate that, but I'll go ahead and close this for now.