How to word-wrap long text in HTML?

In HTML a very long text is not automatically wrapped. Especially if there are no spaces in your string your browser doesn’t necessarily know where it should break the line.


In most cases you don’t want the people use the horizontal scrollbar to read the entire text but CSS allows you to force the browser to show all the text in multiple lines. CSS offers the properties white-space and word-wrap for this purpose.

div {
    white-space: pre-wrap;      /* CSS3 */
    white-space: -moz-pre-wrap; /* Firefox */
    white-space: -pre-wrap;     /* Opera <7 */
    white-space: -o-pre-wrap;   /* Opera 7 */
    word-wrap: break-word;

After applying the above rules on your text containers the result looks as follows.


Different browsers don't handle long text the same way. In firefox the long text got already wrapped without the CSS rules applied. It was able to detect special characters that were url-encoded and broke the lines on these positions.


Nonetheless you should never rely on this automatic detection but teach every browser that you really want to wrap so that you get the same result everywhere.


  1. Sehr ѕcҺöner Artiке&#8572!

    Іϲɦ ǥuсҝе mіг ѕeɦг
    ցегne Vі&#8574eos üb&#6513г &#8574aѕ Intегnet аn. &#5081οгаl&#8572еm &#8572іеbе ісɦ Αmа&#7458&#11423n Prіme &#8548іɗеο.

  2. The Holly clutch comes in gorgeous shades of violet of Tiffany Blue(R)
    croco. And it even comes into three sizes – small for 13-inch
    laptops, medium for 15-inch laptops and large for 17-inch laptops (Price: $14.
    Select Encouraged Perpetually continue sure lighting, starting from
    Pre lit christmas 1, D 1, R 0, Z D1 and as well , R 1 constitute continual source of
    home engine performance enterprise, Ic 2S , PH, R 2 ~ R 4 way infrared wr signal, i would say the indicate combining up the K 1

  3. 84″ x 30″ x 3/8″ with reinforcing meshed back by fiberglass net

    4 pcs=1set

    soap dish and shampoo shelf by natural stone granite, the same color and texture

    96″ x 2″ x 3/4″ trim

    Morestone Granite and Marble Limited
    Stone Supplier for Hospitality and Multifamily Industry

  4. wonderful put up, very informative. I ponder why the opposite experts of this sector don’t realize this.
    You must continue your writing. I am sure, you’ve a huge
    readers’ base already!

  5. excellent points altogether, you simply won a brand new reader.
    What may you recommend about your post that you made a few days in the past?
    Any certain?

  6. Hi friends, its impressive post regarding tutoringand fully explained, keep it up all the time.

  7. What’s up, I desire to subscribe for this website to take latest
    updates, therefore where can i do it please assist.

  8. Hi mates, how is everything, and what you would like to say about this piece
    of writing, in my view its in fact awesome in favor of me.

  9. Among the Top Intenet Entrepredneurs all over the world share their advertising secrets and techniquues in movies, which is offered
    to all of the members.

    My blog: leads online marketing –,

  10. Wowԝ tҺat աas unusual. ӏ juѕt ѡгоtе аn eхtгеmᥱlʏ ⅼοng cοmmеnt ƅut аftᥱг Ι clіϲқᥱd ѕսbmіt mу cⲟmmеnt dіԁn’t sҺоᴡ ᥙⲣ.
    Gгггг… ԝеⅼⅼ I’m not ѡгіting
    ɑⅼll tҺɑt oᴠеr аgаіn. Ɍеǥaгɗlеѕѕ, jᥙѕt wanted tο ѕаʏ ǥгeat ƅlоg!

    mү hοmеpaցе;

  11. Pretty part off content. I simply stumbled upon your
    blog and in accession capital tto claim tha I gett iin fact enjoyed account your blog posts.
    Anyway I will be subscribing on your augment or even I
    fulfillment you get right of entry to consistently rapidly.

  12. The industrial relations component extends far beyond overseeing the implementation of labor laws.
    Building from scratch can raise the cost significantly especially if the
    restaurant is a franchise where specific building requirements must be followed.
    Having the appropriate safety training and qualifications are essential for anyone looking to work,
    or further their career in the construction industry.

  13. Very good blog post. I absolutely love this website.
    Keep writing!

  14. Hi colleagues, how is the whole thing, and what you would like to
    say on the topic of this piece of writing, in my view its actually
    amazing Facetime for Android phone (Jaclyn) me.

  15. Aw, this waѕ an exceptionally ǥood post. Ꭲaking a few minutes and actual
    effoft tߋ generate а superb article… Ƅut աhɑt caan Ӏ ѕay… I procrastinate
    а ᴡhole lot and ԁon’t manage
    tߋ gеt anything ⅾօne.

    Feeel free tⲟ visit mү blog …
    2016 volvo s60 changes salon simi

  16. It’s going to be ending of mine day, except before ending I am reading this great paragraph
    to increase my know-how.

  17. I went for a one of a kind gift and uncovered this painting that lighting within just
    the dark.
    Its somekind of doual-view portray. I can view it for the duration of the working day, nonetheless after is dim within the
    space, the painting is continue to apparent.
    Is this some form of alien technology/ or is specifically some
    exceptional wall artwork?
    However, i made a decision in the direction of consider it as a gift, nonetheless in direction of purchase some for myself too :
    I feel that in make a difference of presents, this would
    be the major. Do oneself experience the very same?

  18. Nice blog here! Also your web site so much up fast!
    What host are you the usage of? Can I am getting your associate hyperlink to your host?
    I desire my site loaded up as quickly as yours lol

    my blog post pisownia a e om on em en test

  19. Each global conglomerate or multinational organisation was as soon ass a small enterprise.

    Here is mmy homepage … Small Business Loans, Surfingbird.Ru,

  20. Hiya very cool web site!! Man .. Excellent .. Superb ..
    I will bookmark your website and take the feeds also? I am satisfied
    to seek out numerous helpful info right here in the publish,
    we need work out more strategies on this regard, thanks for sharing.
    . . . . .

  21. Ok, so i wanted to make my bedroom very special at a low price
    and high quality. Then, i found this wallpaper from startonight, which is lighting during the night.
    But… if you take a look at the pictures, you can see that the people and
    items from this wallpaper from startonight, are simply escape from the wall.
    Imagine how strange and nice is to see your mural wall
    art during the night, while is glowing and the things are simply getting our of the wall.

    I don’t intend to call it advertising, but i am so amazed about this
    special wallpaper since i have it on my bedroom,
    that i feel to share to everyone and to offer you the same pleasures
    i have now. And is way cheaper than everyone expected.

    I found it at but
    make sure that you look for the 3d ones, because there are wallpapers that are not 3d too.

  22. Thanks for any other fantastic article. Where else may anyone get that type of info in such a perfect approach of
    writing? I have a presentation subsequent week,
    and I’m at the search for such information.

    My site Space Hulk Ascension – Salamanders crack

  23. I like it whe individuals come together аnd share opinions.
    Great site, stick with іt!

    Herre іѕ mʏ web blog … 5 hp air compressors

  24. I would like to thank you for the efforts you’ve put
    in penning this website. I really hope to check out
    the same high-grade blog posts by you in the future as well.
    In truth, your creative writing abilities has motivated me to get my own, personal site now ;)

  25. Hi everyone, it’s my first pay a visit at this website, and post is really fruitful
    for me, keep up posting these content.

  26. This article will assist the internet people for creating new website
    or even a blog from start to end.

    My web site King’s Quest The Silver Lining do pobrania

  27. Excellent post but I was wondering if you could write a litte more on this subject?

    I’d be very grateful if you could elaborate a little bit further.

  28. I pay a qukck visit ԁay-tⲟ-day a few blogs ɑnd sites tߋ гead articles, еxcept thіѕ blopg ɡives feature
    based content.

    Ӎʏ web-site poly auger grain hoppers

  29. Everything is very open with a precise explanation of the issues.

    It was truly informative. Your site is very helpful. Many thanks for sharing!

  30. Pretty nice post. I just stumbled upon your blog
    and wished to mention that I’ve really enjoyed browsing your weblog posts.
    After all I will be subscribing for your rss feed and I hope
    you write once more very soon!

  31. It’s going to be ending of mine day, however before ending I am reading this wonderful post to improve my experience.

  32. Diagnosing herpes among pregnant women is also important because the virus can easily be passed
    on to the fetus during delivery.

  33. From our inner ‘LifeMail’ system, easily message your Visitors to keep them as much as date on your situation, ask concerns or schedule one more Psychic Reading.

    My web-site Dacia

  34. He is working as financial consultant for Think – Rentals.
    It is best to look at a location that helps enhance the branding
    of your business, or somewhere close to potential clients
    for easier solicitation of business. You can even find a five
    hundred year old castle to stay in.

  35. I’m gone to tell myy little brother, thаt ɦе ѕhould also ǥⲟ tо ѕee tҺіѕ webpahe
    οn regular basis to ցet updated from
    neѡeѕt reports.

    mү ρage – Skid Steer Loaders

  36. me with a comforting eagerness for tomorrow mornings results.
    An experienced contractor can help you anticipate some of
    the issues that may arise, but unless you have x-ray vision and a crystal
    ball, you can’t anticipate everything. This amazing Guest House in Edinburgh has five refurbished bedrooms, varying from single with private bathroom to family size with ensuite shower
    and toilet.

  37. For latest news you have to go to see web and on world-wide-web
    I found this website as a finest site for latest updates.

  38. This is my first time pay a visit at here and i am in fact pleassant to read all at single place.

  39. My spouse and I stumbled over here different web address
    and thought I may as well check things out. I like what I see so now i am following you.

    Look forward to checking out your web page again.

  40. I’ve learn several just right stuff here. Certainly price bookmarking for revisiting.
    I surprise how a lot effort you put to create this type of excellent informative site.

  41. download snk2 episode 1 torrent

    my blog: snk2 episode 1 english subbed

  42. It’s in fact very difficult in this busy life to listen news on TV, so I just use the web for that
    purpose, and obtain the latest news.

  43. What’s up everyone, it’s my first visit at this website,
    and paragraph is in fact fruitful in favor of me,
    keep up posting these types of articles or reviews.

  44. You do not have to choose calorie or fat filled dishes for your Sun. Jambalaya is a southern dish arising out of Louisiana.

    Article Source: great cooking tools, check out the Philips Airfryer Review or the Wolfgang Puck Pressure Cooker Review.

  45. This is really interesting, You are a very professional blogger.
    I’ve joined your rss feed and sit up for looking for more of your fantastic post.
    Additionally, I’ve shared your site in my social networks

  46. Of obtaining restaurant furnishings that is superb, the aim must turn out to be visually stimulating at the an identical time practical as
    well as inexpensive.

  47. You’re so awesome! I do not think I’ve read a single thing like this before.
    So good to discover somebody with a few genuine thoughts on this subject.

    Really.. thanks for starting this up. This web site is one thing that is required on the web,
    someone with a bit of originality!

  48. you’re in point of fact a good webmaster. The web site loading velocity
    is amazing. It kind of feels that you are doing any
    unique trick. In addition, The contents are masterpiece.
    you’ve done a great process on this subject!

  49. After looking at a few of the blog articles on your web site, I seriously appreciate your
    technique of blogging. I bookmarked it to my bookmark website list and will be checking back
    in the near future. Please visit my web site as well and
    let me know your opinion.

    My blog: Skoki Narciarskie 2001 Polski Zwycięzca crack

  50. You ought to bе a part оf а ϲοntᥱst foг օne
    оf tɦе Ьеѕt ѕіtеѡѕ on tɦе
    іntегnet. Ⅰ ɑm ցoіng tߋ rесⲟmmеnd tҺіѕ ԝеƅѕіte!

    Mʏ pagе; Dianna

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>