CSS

CSS Intro

CSS Intro Quiz

CSS Intro Exercise

CSS Basic

CSS Basic Quiz

CSS Basic Exercise

CSS Advance

CSS Advance Quiz

CSS Advance Exercise

CSS3

CSS3 Quiz

CSS3 Exercise

CSS Properties

CSS Functions

CSS Selectors

White Spacing in CSS

The white-space Property

 

 

The white-space property specifies how white space inside an element is handled. Its values can be set to normalinheritnowrappre, pre-line, pre-wrap, etc

 

Syntax:-

 

Its syntax is:-

< style >

element{

white-space: normal| nowrap| pre| pre-line| pre-wrap| initial| inherit;

}

< /style >

 

Further Explanation:-

 

Value Description
normal Sequences of whitespace will collapse into a single whitespace. Text will be wrapped when necessary.
nowrap Sequences of whitespace will collapse into a single whitespace. Text will never wrap to the next line until be tag is encountered.
pre Whitespace is preserved by the browser. Text will only wrap on line breaks.
pre-line Sequences of whitespace will collapse into single whitespace and will wrap when necessary and on line breaks
pre-wrap Whitespace is preserved by the browser and text will wrap when necessary and on line breaks
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Code Explanation

All Tutorials related to CSS Basic

All Sections related to CSS