SitePoint Sponsor

User Tag List

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

    Responsive text size

    Hi all

    I have a demo here to illustrate

    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
    Madison, WI
    34 Post(s)
    2 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
    Oskarshamn, Sweden
    0 Post(s)
    1 Thread(s)
    Check out for instance


Posting Permissions

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