HOME | PHP Tutorial | CSS
facebook icon
PHP Tutorial

PHP forms
HTML Tutorial

CSS Tutorial

CSS Text Wrap

CSS Tutorial » CSS Text Wrap

CSS word-wrap property allows big words to be able to be broken and wrap anywhere on the edge of a box onto the next line.

We can add CSS word-wrap Property as:
Inline - by using the style attribute in HTML elements
Internal - by using a <style> element in the <head> section
External - by using an external CSS file as style.css


Syntax: Internal & External CSS.
word-wrap: normal or break-word or initial or inherit;

Note: use external CSS instead.

How to create CSS word-wrap property - examples

You can try to execute the following code to change CSS word-wrap property of a text on this page.

Example 1, How to create CSS word-wrap property - examples:

  <!DOCTYPE html>
<title>How to create CSS word-wrap property - examples - example</title>
div {
width: 180px;
border: 2px solid #00FF00;
div.first_box {
word-wrap: normal;
div.second_box {
word-wrap: break-word;
<h1>The word-wrap Property</h1>
<h2>word-wrap: normal (this is default property)</h2>
<div class="first_box"> This div contains a very long word:
word-wrap: normal (this is default property) thisisablablarylongwordblarylongwordblarylongwordblarylongword.
The long word will break and wrap to the next line.</div>
<h2>word-wrap: break-word:</h2>
<div class="second_box"> This div contains a very long word:
will break and wrap - thisisablablarylongwordblarylongwordblarylongwordblarylongwordblarylongword.
The long word will break and wrap to the next line.</div>
Note: Use external CSS instead.

css text wrap, around div, ellipsis, in div, around image, responsive, around circle, white space, none, 2 lines CSS Text Wrap - css tutorial

2707. CSS Lists - CSS tutorial
EchoEcho.Com : The complete CSS tutorial

2229. CSS Tutorial - Display and visible
display:none; hides the paragraph and will NOT keep the space reserved to this element in the course of the document. All other elements will occupy the space reserved to this element and will act as if the element didn

3011. CSS max width - max height - CSS responsive, css tutorial
CSS max width - max height - CSS responsive css tutorial

2231. CSS Tutorial - Float
All HTML elements that comes next to elements aligned using float left or right, will float next to it. To prevent that you need to use the clear attribute with the value: both:

2109. CSS Tutorial - Introduction to CSS
With the help of CSS we can create simple or complex websites, you can build that fancy design that you always like it.

818. CSS Font Families - CSS tutorials - w3resource


Your add here
PHP str_split() function

PHP define() function

PHP implode() function

PHP print() function

PHP htmlentities() function

PHP ltrim() function

PHP htmlspecialchars() function

PHP substr() function

PHP similar_text() function

PHP strstr() function

PHP lcfirst() function

PHP printf() function

PHP explode() function

PHP strrchr() Function

PHP count() Function

PHP htmlspecialchars_decode() function

HTML Text Color Style
SQL WHERE AND & OR multiple conditions
PHP mysqli_connect () Function
CSS Style Text
PHP Operator Types
Magazine Templates