SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Jan 2009
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Responsive text size

    Hi all

    I have a demo here to illustrate

    www.ttmt.org.uk

    Is it possible to have a 100% text size so it fills the available space and then change size with the <p> if the window is resized.

    In my demo the text in paragraph two is set to fill the paragraph by trail and error and if the window is resized the text wraps.

  2. #2
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,734
    Mentioned
    31 Post(s)
    Tagged
    0 Thread(s)
    Grumpy cat says "NO!" ( at least with pure CSS)

    So I take what you are trying to do is 'copyfit' on the web. Think of it this way: in CSS the content determines the size of the container, but not the other way around. This would be no different in text ( which essentially is an anonymous content shell that by definition cannot contain anything itself) . BESIDES the biggest sin in web design is to take control of text size from the viewer.

    Am afraid thsi just not possible with plain CSS, nor is it something that would be considered as a property n future CSS.

    Than begin said .js can do it in convoluted ways (ON WINDOW RE SIZE: counting characters, and obtaining container size, then setting the CSS ..etc) and keep in mind that this wont be perfect either as not all letters are the same size anyway ( you always need humans for true copy fitting)

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Location
    Oskarshamn, Sweden
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Check out for instance http://fittextjs.com/


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •