3

I have been having a problem in which I wanted to wrap long words such as they split by letter. The solution found was:

.wrapword{
    white-space: normal;
    word-break: break-all;
}

However that makes all words split when the sentence runs out of space, even if is possible to just put the whole word in a new line.

What I want to do is first check that words are put in a new line if they don't fit and there is more than one word in that line, if is the only word in that line split by letters.

I attatch a picture to show how is done now that it only splits by letters: enter image description here

enter image description here

The first one should be morless seen as:

Universi

ty of

Reading

of

Systems

Enginee

ring

And the second image should be seen as:

The

Abbey

school

HERE is some HTML code for that:

<div class="wrapword">
    <h2 class="featurette-heading subHeadingText">Locations</h2>
    <div class="row featurette">
        <div class="col-md-4" >
            <h2 class="featurette-heading subHeadingText">University of Reading School of Systems Engineering</h2>
            <p class="bodyText">
                Address:
                    <span class="street-address ">The Queen's Dr</span>, <br />
                    <span class="locality">Reading</span>,
                    <abbr class="region">Berkshire</abbr>;
                    <span class="postal-code">RG6 6AY</span>,
                    <span class="country-name">UK</span>
                <br />
                Phone: <a href="tel:+44118 378 7565">0118 378 7565</a><br />
                Email: <a href="mailto:Billy_kc@hotmail.com">Billy_kc@hotmail.com</a>
            </p>
        </div>
    </div>
</div>
Donald Duck
  • 8,409
  • 22
  • 75
  • 99
Kikadass
  • 314
  • 1
  • 3
  • 14
  • add your html code – Saif Mar 21 '16 at 03:13
  • 2
    `word-wrap: break-word` – L777 Mar 21 '16 at 03:15
  • 2
    Possible duplicate of [Smarter word break in CSS?](http://stackoverflow.com/questions/12699800/smarter-word-break-in-css) –  Mar 21 '16 at 03:44
  • word-wrap: break-word does nothing for me and is not a duplicate because in that post is just talking about breaking words, which I've done. However it doesn't take into account the fact that I first want to break the sentence if possible. – Kikadass Mar 21 '16 at 11:44
  • This display seems to be under the control of a lot of 'classes', which is fine, except we do not know all the manipulations of text position and wrap boundaries created by your styling classes. The above comments by others are correct. We need to know how your styling affects line and word splits. –  Mar 24 '16 at 00:28

0 Answers0