Manual break

Discussion in 'HTML' started by =?ISO-8859-2?Q?Rafa=B3?= Maj, Aug 19, 2007.

  1. Hello,
    is there a html entity or something that tells browser where it can brake
    text when lacking white spaces?

    In example I have text:
    aaaaaaaaaaaaammmmmmmmmmmmmmmmmmmmmmmmmmmzzzzz

    and its displayed in container that (with this font etc) will hold up to 10
    characters (or will overflow etc which is bad).

    I can insert spaces manually like
    aaaaaaaaaa aaammmmmmm mmmmmmmmmm mmmmmmmmmz zzzzzzz
    and so on.

    But can I insert not a space but some character that will be only used if no
    other is suitable to brake the stirng with?
     
    =?ISO-8859-2?Q?Rafa=B3?= Maj, Aug 19, 2007
    #1
    1. Advertising

  2. Scripsit Rafal Maj:

    > Hello,
    > is there a html entity or something that tells browser where it can
    > brake text when lacking white spaces?


    There's something, namely the <wbr> tag, which is widely supported by
    browsers though not contained in any specification.

    > In example I have text:
    > aaaaaaaaaaaaammmmmmmmmmmmmmmmmmmmmmmmmmmzzzzz


    Looks somewhat odd. I wonder what it means. Generally, when you have such a
    problem, it's best to consider whether the content is meaningful and how it
    might be changed.

    > and its displayed in container that (with this font etc) will hold up
    > to 10 characters (or will overflow etc which is bad).


    "Doctor, it hurts when I do this."
    "Then don't do that."

    That is, why do you create the problem by squeezing something into a narrow
    area where it cannot fit?

    More info: http://www.cs.tut.fi/~jkorpela/html/nobr.html#suggest

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Aug 19, 2007
    #2
    1. Advertising

  3. ..oO(Rafa³ Maj)

    >is there a html entity or something that tells browser where it can brake
    >text when lacking white spaces?


    &shy;

    Micha
     
    Michael Fesser, Aug 19, 2007
    #3
  4. Scripsit Michael Fesser:

    > .oO(Rafa³ Maj)
    >
    >> is there a html entity or something that tells browser where it can
    >> brake text when lacking white spaces?

    >
    > &shy;


    That's soft hyphen, which is ignored by Firefox and treated as a
    _hyphenation_ hint by most other browsers.

    foo&shy;bar produces, when it does not fit,

    foo-
    bar

    (notice the hyphen) whereas foo<wbr>bar produces, when it does not fit,

    foo
    bar

    (notice the lack of hyphen).

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Aug 19, 2007
    #4
  5. ..oO(Jukka K. Korpela)

    >Scripsit Michael Fesser:
    >
    >> .oO(Rafa³ Maj)
    >>
    >>> is there a html entity or something that tells browser where it can
    >>> brake text when lacking white spaces?

    >>
    >> &shy;

    >
    >That's soft hyphen, which is ignored by Firefox


    Firefox 3 will support it, most other modern browsers already do.

    >and treated as a
    >_hyphenation_ hint by most other browsers.


    Correct, but that's what I think the OP wants. Of course it's just a
    guess, but it's the one that makes the most sense to me.

    Micha
     
    Michael Fesser, Aug 19, 2007
    #5
    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. Neil Zanella
    Replies:
    1
    Views:
    5,571
    Arvind Kumar
    Jul 8, 2003
  2. alex
    Replies:
    1
    Views:
    806
    Dieter D'Hoker
    Jun 25, 2004
  3. JONL
    Replies:
    0
    Views:
    666
  4. sloan
    Replies:
    1
    Views:
    4,386
    m_manzanelli
    Aug 8, 2006
  5. Replies:
    12
    Views:
    1,008
Loading...

Share This Page