How to wrap text to fill a DIV (like in MS-Excel) [duplicate]


Tags: javascript,jquery,html,css

Problem :

Possible Duplicate:
Auto-size dynamic text to fill fixed size container

How can I get this text to shrink/enlarge the font-size automatically to fit perfectly wrapped into the box size?

I'm trying to do this with HTML & CSS but I don't see any option. I don't mind using javascript/jquery if there is a way.

text overflowing the container



Solution :

Something like this maybe?

http://jsbin.com/opuzur/3/edit

Edit: Of course someone had already come up with a better solution... Check out the link in John's comment, has some good solutions! Still, it was good fun to have a crack at it! :)


    CSS Howto..

    how to do CSS for below image box (not a shadow box) [duplicate]

    How to use body horizontal scrollbar in free jqgrid

    CSS: show triangles in a row

    How to change this FontAwesome to image in Css?

    How to change this table layout to a css layout?

    How to update the attribute while overriding a style defined in css?

    How to put container div under menu using CSS

    How to scroll draw each SVG path one at a time (chronologically)?

    how to align vertically an absolute element with a variable height above its parent?

    How to output compiled CSS files to a different production folder using grunt and grunt-contrib-less

    How to achieve following style for horizontal rule with css

    How to start different elements on different keyframes of an animation in CSS

    How to put a
  • over an
    • how to use CSS clip-path in IE? [closed]

      How to CSS the select field so that it occupy the entire cell of my table?

      CSS HTML - How to add more outer colour on the drop down menus and more than one word per drop down

      How to avoid setting CSS class to one table among two tables?

      How to override position : absolute in css?

      toggleClass: How does this CSS work?

      How can I set a google-font as default-font in CKEditor?

      How to get an App made using JavaScript to autoresize for other Apple Devices?

      How to align image with text in a table ? (jquery datatable sort image with text in table header)

      how does responsive design work?

      How can I center a CSS background image as if the image had a different width (without cutting the bgimg off)?

      Hide all other divs with the same name on div hover, show hovered div

      onsen ui 2 : how to implement android style scrollable tabbar?

      CSS: How to override a class style with an enclosing div

      How to apply a CSS 3 blur filter to a background image

      How to use CSS to center the buttons?

      How to make pixel perfect font in css?