ankitweblogic logo
W e b t u t o r i a l s

Types of Style Sheet

Import Style Sheet

CSS3 Border Images

CSS2 Clip Property

CSS3 Background

CSS3 Color Property

CSS3 Linear Gradient

CSS3 Radial Gradient

CSS3 text-shadow

CSS3 word-wrap

CSS3 box-shadow

CSS text-stroke

CSS3 Nested Menu

CSS3 Combinators

CSS3 Pseudo Classes

CSS3 Pseudo Element

CSS3 2D Transform

CSS3 2D Transform

CSS3 3D Transform

CSS3 Transitions

CSS3 Animation

CSS3 Animation Exercise

CSS3 Multiple Columns

After Before Shadow

CSS3 Resize Property

CSS3 Shapes

CSS Tooltip

CSS Hover Effect

CSS3 word-wrap property

The word-wrap property allows long words to be broken and wrap onto the next line.

Syntax: word-wrap: normal | break-word;
<html>
<head>
<style> 
p.test {
    width: 11em; 
    border: 1px solid #000000;
    word-wrap: break-word;
}
</style>
</head>
<body>

<p class="test"> This paragraph contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.</p>

</body>
</html>

css3 word-break property

The CSS word-break property is used to specify how to break lines within words.

<html>
<head>
<style> 

p {
    width: 140px; 
    border: 1px solid #000000;
    word-break: break-all;
}
</style>
</head>
<body>

<p>This paragraph contains some text. This paragraph contains some text. This paragraph contains some text. This paragraph contains some text. This paragraph contains some text. This paragraph contains some text. </p>

</body>
</html>