Preventing widows on titles of posts

  • Unknown's avatar

    I notice that for the title of my posts that depending on the screen size, it might produce a “widow” (one word) on the next line. Is there a way to prevent this (e.g. when this happens force two words to appear on the next line, instead of just one)?

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Oops, the problem isn’t with the titles of the posts, but with h2. What do I need to put in the CSS to make it happen?

  • Unknown's avatar

    This isn’t something that can be fixed with CSS. Some themes automatically add a non-breaking space between the last two words of titles, sentences and paragraphs to prevent this, but it is a double-edged sword. Some like it and some do not.

    What you would have to do is to manually add a non-breaking space between the last two words of a title when you add the title in the editor instead of a regular space to prevent this from happening. This is the code you would add, but without the space between the & and n.
    & nbsp;

  • Unknown's avatar

    thanks, all things considered a minor problem. Thanks for taking the time to explain.

  • Unknown's avatar

    No worries, and you are welcome.

  • The topic ‘Preventing widows on titles of posts’ is closed to new replies.