Text Stretching Outside Page?

Discussion in 'HTML & Website Design' started by Pudge1, Oct 25, 2013.

  1. #1
    http://notecorner.com/view_note.php?id=10009

    I can't for the life of me figure out how to make it so the text isn't going off the page. I've tried many different things and researched online but have been unable to find anything. Running Chrome/Safari on Mac it looks messed up in both of them.

    Any suggestions?
     
    Pudge1, Oct 25, 2013 IP
  2. wiicker95

    wiicker95 Well-Known Member

    Messages:
    438
    Likes Received:
    37
    Best Answers:
    10
    Trophy Points:
    100
    #2
    Does a word that long exist in English? I don't think so (ok let's ignore llanfairpwllgwyngill[...]gogogoch and all other silly words).
    Your text is going off the page simply because you didn't put any spaces there. Add a space every 15 chars, or write non gibberish, and there you go, problem solved!

    Additionally, you can hide the overflow of that container by giving a "hidden" value to overflow property of the container.
     
    wiicker95, Oct 25, 2013 IP
  3. Tom8521

    Tom8521 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Yes, the above answer is correct. Without a space in the 'word' the system doesn't know to place a break appropriately, hense not putting it on another line when it reaches the end of the div.

    It is, however, possible to add this to your CSS code making the overflow text vanish...

    overflow: hidden;

    Magic!
     
    Tom8521, Oct 25, 2013 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    You can also now force a word-wrap using an IE 5.x property that was FINALLY adopted into CSS3 -- so it works pretty-much everywhere.

    word-wrap:break-word;

    https://developer.mozilla.org/en-US...directlocale=en-US&redirectslug=CSS/word-wrap

    Like a lot of CSS3 -- stuff IE's been able to do for a decade and a half. But of course, IE is a backwards browser and Microsoft is the ultimate evil, they couldn't possibly have done anything useful decades ahead of everyone else.
     
    deathshadow, Oct 25, 2013 IP
    ryan_uk likes this.