Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to make a sentence stay inline?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #28988
    Tadas
    Member

    Hello everyone,

    I have a small box (fixed width and height) with some text in it. It’s great if the string fits in it or if it’s just one word (even if too long), then only the part that fits is visible (using overflow:hidden). The problem is, that if the string is more than one word I would like it to stay on the line and just hide what doesn’t fit without the text going to the other line.

    I hope I made myself clear.
    If not, maybe this will:
    [img]http://img.skitch.com/20100512-g2pdpwpfig9tr39h883etknj62.preview.jpg[/img]
    Live example here: http://ramiai.net/dev/bc/

    Any help would be greatly appreciated!

    #75406
    tcione
    Member

    The easiest solution that comes to me is to wrap the text in a <p></p>, then set a higher width than the divs’ one.

    #75427
    Tcooper
    Member

    Just add

    Code:
    white-space:nowrap;
    #75434
    Tadas
    Member

    Exactly what needed! Thank you so much!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.