Forums

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

Home Forums CSS zero-width space after hyphen

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #195293
    Jerry
    Participant

    I am trying to have a hyphen, e.g. Mon-Tues, break at the end of a line in firefox using CSS, without success.

    .couponwp p 02D:after {
    content: "\200B";
    }

    Of note, the CSS below works fine:

    `.couponwp p {
    font-size: 12px;
    }’

    Thank you for your time
    Jerry

    Sorry about the confusion, the forum will no accept the complete code for hyphen:after
    Jerry

    #195295
    Paulie_D
    Member

    A demo in Codepen might be of more help.

    Is this an issue only in Firefox or other browsers too.

    #195296
    Jerry
    Participant

    Thank you for responding,

    Posting on this forum is the first time I heard of codepen, I will learn how to use it.

    Only a firefox issue. Fire fox will not break a hyphen at the end of a line if there is four or less characters before or after the hyphen.

    Jerry

    #195303
    DanielNichesite3
    Participant

    Really strange. Different browse always make the different bug to developer. I often has these kind of error with IE8.

    #195356
    Jerry
    Participant

    When I use word-break: break-all in firefox words break like this:

    some-thin
    g

    or

    somethi
    ng

    When I use word-break: normal nothing happens.

    Instead of trying to add the zero-width-space after the hyphen in firefox, is there a way using CSS to replace the hyphen with one that would respond to word-break: normal

    Thank you for your time

    Jerry

    #195364
    Paulie_D
    Member

    I’m still a little confused…why would you have a ‘non-word’ like “some-thing”.

    And why would you break “Mon-Tues”?

    Are you trying to break actual hyphenated words or prevent hyphenated words from breaking.

    There is an HTML entity for a non-breaking hyphen.

    ‑
    
    #195368
    Jerry
    Participant

    some-thing was just used as a test.

    I am trying to break actual hyphenated words e.g “Mon-Tues” Putting a class or code at the location of each hyphenated word e.g. “Mon-Tues”, “10:00am-11:30pm” ect… is not an option for this situation.

    Thank you for responding.

    Jerry

    #195373
    Jerry
    Participant

    Thank you for responding,

    Is it not possible to force a hyphen, e.g. Mon-Tues, to break at the end of a line in firefox using CSS ?

    Jerry

    #195395
    Jerry
    Participant

    Thank you for your response. Maybe I can get the zero width space to work.

    The hyphen breaks are for coupons with a narrow width.

    There are a number of possibilities including word-wrap, overflow-wrap that I should probability look at again.

    Thank you for your time

    Jerry

    #195686
    Jerry
    Participant

    Thank you for that option. Your help has been appreciated.

    Jerry

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