Basic formatting HTML question

Discussion in 'HTML' started by Fred, Apr 24, 2006.

  1. Fred

    Fred Guest

    Greetings friends and neighbors!

    I'm fairly new to HTML and so a pretty basic question....

    On a page with all text, when the lines wrap at the right, some words butt
    right up to the very edge of the screen. This makes it look like the text
    runs off the screen, even though it doesn't.

    I think I have seen code that makes the text take up only a certain amount
    of the screen -- say 95%. Can someone pls give me a hand on this?

    Thanks much!

    Fred
     
    Fred, Apr 24, 2006
    #1
    1. Advertising

  2. Fred

    Mark Parnell Guest

    Deciding to do something for the good of humanity, Fred
    <> declared in
    alt.html,alt.html.editors.webedit,alt.html.editors:

    [alt.html.editors removed as it doesn't exist on my server]
    > On a page with all text, when the lines wrap at the right, some words butt
    > right up to the very edge of the screen.


    Not by default in any graphical browser I know of. All have default
    margin and/or padding on html and/or body.

    > I think I have seen code that makes the text take up only a certain amount
    > of the screen -- say 95%. Can someone pls give me a hand on this?


    There are any number of ways, depending on exactly what you want.
    Applying a small amount of padding to the text's containing element is
    perhaps the simplest.

    --
    Mark Parnell
    My Usenet is improved; yours could be too:
    http://blinkynet.net/comp/uip5.html
     
    Mark Parnell, Apr 24, 2006
    #2
    1. Advertising

  3. Fred

    Jim Moe Guest

    Fred wrote:
    >
    > I'm fairly new to HTML and so a pretty basic question....
    >
    > On a page with all text, when the lines wrap at the right, some words butt
    > right up to the very edge of the screen. This makes it look like the text
    > runs off the screen, even though it doesn't.
    >

    Have you studied CSS (Cascading Style Sheets) yet? It is a powerful tool
    for applying style rules to HTML markup.
    In particular what you are looking for are margin or padding properties.

    --
    jmm (hyphen) list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)
     
    Jim Moe, Apr 24, 2006
    #3
  4. Mark Parnell <> wrote:

    > [alt.html.editors removed as it doesn't exist on my server]


    Followups trimmed to alt.html. There was no reason to crosspost in the first
    place.

    >> On a page with all text, when the lines wrap at the right, some words butt
    >> right up to the very edge of the screen.

    >
    > Not by default in any graphical browser I know of. All have default
    > margin and/or padding on html and/or body.


    My guess is that OP, or the unspecified authoring tool he's using, has put
    something on the page that removes those defaults. The most efficient
    approach is probably to start over. Trying to fix some markup that was
    generated by an authoring tool that does such nasty things, or to fix markup
    one has copied from somewhere without understanding it, tends to lead to more
    confusion rather than clarity.

    Of course, I _could_ be wrong. The OP needs to post the URL (and to specify
    the browser(s) in which the problem appears) to demonstrate this.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, Apr 24, 2006
    #4
  5. Fred

    Andy Dingley Guest

    Fred wrote:

    > Can someone pls give me a hand on this?


    Try the Psychic Hotline.

    Otherwise post a URL to the broken page so that we can see it. Can't
    fix what we can't see.
     
    Andy Dingley, Apr 24, 2006
    #5
  6. Fred

    cypete Guest

    Hey what if you use paragraphs like this <p>some text here</p> and it
    will stretch alright.
    Hope this will help you..
     
    cypete, Apr 24, 2006
    #6
  7. Fred

    dorayme Guest

    In article <C6Z2g.3401$BO2.1606@trnddc02>,
    "Fred" <> wrote:

    > Greetings friends and neighbors!
    >
    > I'm fairly new to HTML and so a pretty basic question....
    >
    > On a page with all text, when the lines wrap at the right, some words butt
    > right up to the very edge of the screen. This makes it look like the text
    > runs off the screen, even though it doesn't.
    >
    > I think I have seen code that makes the text take up only a certain amount
    > of the screen -- say 95%. Can someone pls give me a hand on this?
    >
    > Thanks much!
    >
    > Fred


    Hi Fred,

    In the head of your doc between <head> and </head> put this:

    body {padding-right:10px}

    and write away...

    All the best,

    The Nice One

    --
    dorayme
     
    dorayme, Apr 25, 2006
    #7
  8. Fred

    frederick Guest

    dorayme wrote:
    > In the head of your doc between <head> and </head> put this:
    >
    > body {padding-right:10px}
    >
    > and write away...


    That's nice. A shame that it won't actually do anything useful!

    Perhaps you meant the following:

    <style type="text/css">
    body {padding-right:10px}
    </style>

    Not "best practice" either, but at least the browser'll do what was
    intended!


    --
    AGw.
     
    frederick, Apr 25, 2006
    #8
  9. Fred

    dk_sz Guest

    dk_sz, Apr 25, 2006
    #9
  10. Fred

    dorayme Guest

    In article
    <>,
    "frederick" <> wrote:

    > dorayme wrote:
    > > In the head of your doc between <head> and </head> put this:
    > >
    > > body {padding-right:10px}
    > >
    > > and write away...

    >
    > That's nice. A shame that it won't actually do anything useful!
    >
    > Perhaps you meant the following:
    >
    > <style type="text/css">
    > body {padding-right:10px}
    > </style>
    >
    > Not "best practice" either, but at least the browser'll do what was
    > intended!


    oops... Yes, I assumed too much...

    --
    dorayme
     
    dorayme, Apr 26, 2006
    #10
  11. Fred

    Fred Guest

    Greetings friends and neighbors!

    I'm fairly new to HTML and so a pretty basic question....

    On a page with all text, when the lines wrap at the right, some words butt
    right up to the very edge of the screen. This makes it look like the text
    runs off the screen, even though it doesn't.

    I think I have seen code that makes the text take up only a certain amount
    of the screen -- say 95%. Can someone pls give me a hand on this?

    Thanks much!

    Fred
     
    Fred, May 9, 2006
    #11
  12. "Fred" <> wrote:

    > On a page with all text, when the lines wrap at the right, some words butt
    > right up to the very edge of the screen. This makes it look like the text
    > runs off the screen, even though it doesn't.


    You seem to think that the page is viewed in fullscreen mode. That's surely
    possible, but you should think in terms of a _window_ or, most appropriately,
    _canvas_ (the part of window or paper or other presentation area that is
    allocated for rendering the document).

    > I think I have seen code that makes the text take up only a certain amount
    > of the screen -- say 95%. Can someone pls give me a hand on this?


    That would be possible, but you really don't want that. In most browsers,
    there is small but usually sufficient padding between the page content and
    the canvas edge. Have you done something to remove it?

    But if you think the default padding is insufficient, you can use a little
    piece of CSS to suggest something slightly different, e.g.

    <style type="text/css">
    body { margin: 0;
    padding: 0.4em 1em 0.4em 1.5em; }
    </style>

    This sets the top and and bottom padding to 0.4em, right padding to 1em and
    left padding to 1.5em, which should be (more than) sufficient. The em unit
    roughly corresponds to 2 or 2.5 times the average width of a character.

    Followups rationalized.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, May 9, 2006
    #12
  13. Fred

    Arne Guest

    Once upon a time *Jukka K. Korpela* wrote:
    > "Fred" <> wrote:
    >
    >> On a page with all text, when the lines wrap at the right, some
    >> words butt right up to the very edge of the screen. This makes it
    >> look like the text runs off the screen, even though it doesn't.

    >
    > You seem to think that the page is viewed in fullscreen mode. That's
    > surely possible, but you should think in terms of a _window_ or, most
    > appropriately, _canvas_ (the part of window or paper or other
    > presentation area that is allocated for rendering the document).
    >
    >> I think I have seen code that makes the text take up only a certain
    >> amount of the screen -- say 95%. Can someone pls give me a hand on
    >> this?

    >
    > That would be possible, but you really don't want that. In most
    > browsers, there is small but usually sufficient padding between the
    > page content and the canvas edge. Have you done something to remove
    > it?
    >
    > But if you think the default padding is insufficient, you can use a
    > little piece of CSS to suggest something slightly different, e.g.
    >
    > <style type="text/css"> body { margin: 0; padding: 0.4em 1em 0.4em
    > 1.5em; } </style>
    >
    > This sets the top and and bottom padding to 0.4em, right padding to
    > 1em and left padding to 1.5em, which should be (more than)
    > sufficient. The em unit roughly corresponds to 2 or 2.5 times the
    > average width of a character.


    Maybee you also should say that the peace of CSS should be set to the
    header section of the page, concidering OP say he is "fairly new" to
    HTML and the question is basic :)

    So abowe the </head> in the source code is where it should be placed.

    --
    /Arne

    Proud User of SeaMonkey. Get your free copy:
    http://www.mozilla.org/projects/seamonkey/
     
    Arne, May 9, 2006
    #13
  14. Fred

    Mark Parnell Guest

    Deciding to do something for the good of humanity, Fred
    <> declared in
    alt.html,alt.html.editors.webedit,alt.html.editors:

    > I'm fairly new to HTML and so a pretty basic question....


    You said all that 2 weeks ago. Did you not like the answers? They're
    unlikely to change.

    (alt.html.editors removed again as it still doesn't exist on my
    newsserver, and follow-ups set to alt.html).

    --
    Mark Parnell
    My Usenet is improved; yours could be too:
    http://blinkynet.net/comp/uip5.html
     
    Mark Parnell, May 10, 2006
    #14
  15. "Fred" <> wrote in message
    news:eek:9%7g.3089$OF6.485@trnddc06...
    > Greetings friends and neighbors!
    >
    > I'm fairly new to HTML and so a pretty basic question....


    Which browser are you using? What kind of page are you looking at -- can you
    tell if it's just HTML, CSS / HTML, pure text file?

    Post the page URL, or give me the "View source" view.

    If you very new to HTML, the dead easiest way is to set up a one column
    table.

    <table style="width: 95%; text-align: left;" border="1" cellpadding="2"
    cellspacing="2">
    <tbody>
    <tr>
    <td>
    Put your text file here.
    </td>
    </tr>
    </tbody>
    </table>

    Of course, there's other stuff that has to go at the beginning and end of
    your file but open any simple page, "View source" and you should be able to
    figure it out. The text file will also need <br> or <p> tags to separate
    paragraphs, otherwise you'll see one continuous sentence. If you don't want
    to see a border around the table, well, you get the idea. . .

    http://www.htmlcodetutorial.com/tables/


    M
     
    Michael Laplante, May 10, 2006
    #15
  16. Gazing into my crystal ball I observed Arne <>
    writing in news::

    > the peace of CSS


    And peace be with you...

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, May 10, 2006
    #16
  17. Fred

    Fred Guest

    Thanks, Michael!!

    "Michael Laplante" <> wrote in message
    news:vpa8g.8226$Qq.71@clgrps12...
    > "Fred" <> wrote in message
    > news:eek:9%7g.3089$OF6.485@trnddc06...
    > > Greetings friends and neighbors!
    > >
    > > I'm fairly new to HTML and so a pretty basic question....

    >
    > Which browser are you using? What kind of page are you looking at -- can

    you
    > tell if it's just HTML, CSS / HTML, pure text file?
    >
    > Post the page URL, or give me the "View source" view.
    >
    > If you very new to HTML, the dead easiest way is to set up a one column
    > table.
    >
    > <table style="width: 95%; text-align: left;" border="1" cellpadding="2"
    > cellspacing="2">
    > <tbody>
    > <tr>
    > <td>
    > Put your text file here.
    > </td>
    > </tr>
    > </tbody>
    > </table>
    >
    > Of course, there's other stuff that has to go at the beginning and end of
    > your file but open any simple page, "View source" and you should be able

    to
    > figure it out. The text file will also need <br> or <p> tags to separate
    > paragraphs, otherwise you'll see one continuous sentence. If you don't

    want
    > to see a border around the table, well, you get the idea. . .
    >
    > http://www.htmlcodetutorial.com/tables/
    >
    >
    > M
    >
    >
     
    Fred, May 10, 2006
    #17
  18. Fred

    Fred Guest

    Sorry, Mark. I didn't see the followups.

    "Mark Parnell" <> wrote
    >
    > > I'm fairly new to HTML and so a pretty basic question....

    >
    > You said all that 2 weeks ago. Did you not like the answers? They're
    > unlikely to change.
     
    Fred, May 10, 2006
    #18
  19. Fred

    Fred Guest

    Thanks, Arne!!

    "Arne" <> wrote in message
    news:...
    > Once upon a time *Jukka K. Korpela* wrote:
    > > "Fred" <> wrote:
    > >
    > >> On a page with all text, when the lines wrap at the right, some
    > >> words butt right up to the very edge of the screen. This makes it
    > >> look like the text runs off the screen, even though it doesn't.

    > >
    > > You seem to think that the page is viewed in fullscreen mode. That's
    > > surely possible, but you should think in terms of a _window_ or, most
    > > appropriately, _canvas_ (the part of window or paper or other
    > > presentation area that is allocated for rendering the document).
    > >
    > >> I think I have seen code that makes the text take up only a certain
    > >> amount of the screen -- say 95%. Can someone pls give me a hand on
    > >> this?

    > >
    > > That would be possible, but you really don't want that. In most
    > > browsers, there is small but usually sufficient padding between the
    > > page content and the canvas edge. Have you done something to remove
    > > it?
    > >
    > > But if you think the default padding is insufficient, you can use a
    > > little piece of CSS to suggest something slightly different, e.g.
    > >
    > > <style type="text/css"> body { margin: 0; padding: 0.4em 1em 0.4em
    > > 1.5em; } </style>
    > >
    > > This sets the top and and bottom padding to 0.4em, right padding to
    > > 1em and left padding to 1.5em, which should be (more than)
    > > sufficient. The em unit roughly corresponds to 2 or 2.5 times the
    > > average width of a character.

    >
    > Maybee you also should say that the peace of CSS should be set to the
    > header section of the page, concidering OP say he is "fairly new" to
    > HTML and the question is basic :)
    >
    > So abowe the </head> in the source code is where it should be placed.
    >
    > --
    > /Arne
    >
    > Proud User of SeaMonkey. Get your free copy:
    > http://www.mozilla.org/projects/seamonkey/
     
    Fred, May 10, 2006
    #19
  20. Fred

    Fred Guest

    Thanks, JK!!

    "Jukka K. Korpela" <> wrote in message
    news:Xns97BE9A994D7D5jkorpelacstutfi@193.229.4.246...
    > "Fred" <> wrote:
    >
    > > On a page with all text, when the lines wrap at the right, some words

    butt
    > > right up to the very edge of the screen. This makes it look like the

    text
    > > runs off the screen, even though it doesn't.

    >
    > You seem to think that the page is viewed in fullscreen mode. That's

    surely
    > possible, but you should think in terms of a _window_ or, most

    appropriately,
    > _canvas_ (the part of window or paper or other presentation area that is
    > allocated for rendering the document).
    >
    > > I think I have seen code that makes the text take up only a certain

    amount
    > > of the screen -- say 95%. Can someone pls give me a hand on this?

    >
    > That would be possible, but you really don't want that. In most browsers,
    > there is small but usually sufficient padding between the page content and
    > the canvas edge. Have you done something to remove it?
    >
    > But if you think the default padding is insufficient, you can use a little
    > piece of CSS to suggest something slightly different, e.g.
    >
    > <style type="text/css">
    > body { margin: 0;
    > padding: 0.4em 1em 0.4em 1.5em; }
    > </style>
    >
    > This sets the top and and bottom padding to 0.4em, right padding to 1em

    and
    > left padding to 1.5em, which should be (more than) sufficient. The em unit
    > roughly corresponds to 2 or 2.5 times the average width of a character.
    >
    > Followups rationalized.
    >
    > --
    > Yucca, http://www.cs.tut.fi/~jkorpela/
    > Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    >
    >
     
    Fred, May 10, 2006
    #20
    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. Guest
    Replies:
    2
    Views:
    350
    Guest
    Mar 22, 2005
  2. Jack
    Replies:
    2
    Views:
    344
    Ben Fidge
    Feb 8, 2006
  3. Engineer
    Replies:
    6
    Views:
    627
    Jeremy Bowers
    May 1, 2005
  4. Jack

    Basic formatting for HTML text in ASP.NET 1.1 ?

    Jack, Dec 28, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    183
    Paul Clement
    Dec 28, 2005
  5. Mike Copeland

    basic::string Formatting

    Mike Copeland, Mar 31, 2014, in forum: C++
    Replies:
    2
    Views:
    93
    James Kanze
    Apr 1, 2014
Loading...

Share This Page