Loading ...
Sorry, an error occurred while loading the content.

max-width in CSS and JS

Expand Messages
  • Axel Berger
    Trying to conform to all window sizes I need to restrain my lines to a legible length limit. This should be stated in em so as not to restrict readers with
    Message 1 of 1 , Mar 9, 2007
    • 0 Attachment
      Trying to conform to all window sizes I need to restrain my lines to a
      legible length limit. This should be stated in "em" so as not to
      restrict readers with big fonts unecessarily. On the other hand there
      are pictures so the limit should not be too small even with a tiny font.
      So I need one maximum in "em" and one in "px" and choose the bigger of
      the two.
      Is there any chance to do this in CSS?
      (Currently http://berger-odenthal.de does this with "px" alone
      HTML { margin-left:1em}
      BODY { margin-left:auto; margin-right:1em; max-width:700px}
      but that's less than satisfactory. Also the margin might benefit from
      having a measure in "em" and one in "%" and taking the smaller of the
      two.)

      Secondly for those who want it I'd like to offer to resize their window
      to optimal width. But I seem not to be able to read the default font
      size or the width of an "em" or anything eqivalent in Javascript. I hope
      I'm wrong and there is such a possibility.

      Axel
    Your message has been successfully submitted and would be delivered to recipients shortly.