Re: Constraining text within a border

Discussion in 'HTML' started by Beauregard T. Shagnasty, Apr 9, 2008.

  1. Don W wrote:

    > Is there a way to create a border of fixed height and width to constrain
    > whatever text is within?

    Using pixel measurements? No.

    > If the text is only a few characters it should be rendered in a very
    > large font. If there is a lot of text within the border, it should
    > be rendered with a smaller font so that it fits within the border.

    Use em units for sizing the <div> instead. Then when your visitor
    increases hir font size, the box will increase along with it.

    > I tried using a table and setting the height and width, but the
    > browser seems to take this as nothing more than a suggestion. When
    > there's a lot of text in a cell, it just widens the column for me.

    That is how tables work. You can't stick fourteen eggs in a dozen-egg

    How about posting the URL to your sample page? It would make it much
    easier to give advice, rather than just guessing at what you are trying
    to do.

    -Friends don't let friends drive Vista
    Beauregard T. Shagnasty, Apr 9, 2008
    1. Advertisements

  2. Don W wrote:

    > This page is not to be published. Actually, I need to print some
    > placards from a database and a browser seems like a good way to do
    > that.

    Ah. Well, browsers are not normally regarded as the best "programs for

    > There are two sizes of placard I need to print -- 2 inches by 12
    > inches and 4 inches by 12 inches. Whatever text goes into those
    > areas must fit in those areas, so the font size should be adjusted
    > accordingly. I was hoping something like the 'max-width' attribute
    > could help me accomplish this, but it doesn't seem to work that way.

    2 inches high by 12 inches wide? And nobody else will ever see it?

    > If there is a way to know how big the text will be when rendered, I
    > can adjust the font until it fits. Do you know of a way to do what
    > I'm trying to do?

    Sounds more like a job for either a word processor or a desktop
    publishing application, not HTML and a browser.

    And 12 inches ... do a landscape document on "legal size paper" and take
    it to a bumper sticker printer. :)

    -Friends don't let friends drive Vista
    Beauregard T. Shagnasty, Apr 9, 2008
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kwaj
    David Bishop
    Apr 25, 2004
  2. Replies:
    Eliyahu Goldin
    Apr 17, 2005
  3. David Valera
    David Valera
    May 10, 2005
  4. Bryan Ax
    Peter Flynn
    May 17, 2006
  5. Coder
    Cowboy \(Gregory A. Beamer\)
    Jun 24, 2006

Share This Page