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
    box.

    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.

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

  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
    printing."

    > 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. :)

    --
    -bts
    -Friends don't let friends drive Vista
     
    Beauregard T. Shagnasty, Apr 9, 2008
    #2
    1. Advertising

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
    Replies:
    1
    Views:
    643
    David Bishop
    Apr 25, 2004
  2. Replies:
    1
    Views:
    640
    Eliyahu Goldin
    Apr 17, 2005
  3. David Valera
    Replies:
    0
    Views:
    482
    David Valera
    May 10, 2005
  4. Bryan Ax
    Replies:
    6
    Views:
    563
    Peter Flynn
    May 17, 2006
  5. Coder
    Replies:
    1
    Views:
    717
    Cowboy \(Gregory A. Beamer\)
    Jun 24, 2006
Loading...

Share This Page