Forums

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

Home Forums CSS Help text width!

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #36166
    XaviJr
    Participant

    I can’t figure this out..

    I have a simple text and I want to make it centered inside a div with a maximum width (200px). I have display:block and width:200px .
    The text is appearing centered until it reaches the 200px and then it continues in the same line, there’s no break.

    Any idea what I’m doing wrong?

    #94818
    jamygolden
    Member

    Why don’t you create a jsfiddle of the problem?

    #94827
    XaviJr
    Participant

    I would but jsfiddle gives me the correct result:
    http://jsfiddle.net/L6TrY/

    #94828
    Mottie
    Member

    LMAO… I have no idea why, but this is making me laugh hysterically

    I would but jsfiddle gives me the correct result:

    #94829
    XaviJr
    Participant

    Well It’s true. This is something that should be easy to implement. For some reason this isn’t working, so maybe someone could have a clue why I’m seeing a different behavior.
    I don’t know what’s funny about that.

    #94831
    XaviJr
    Participant

    Ok, I know what’s the problem with my jsfiddle example.

    This is the problem:
    http://jsfiddle.net/L6TrY/5/

    If I have a unique bigger word it continues after the 200px width.

    #94832
    XaviJr
    Participant

    Solved. overflow: hidden;

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.