CSS attribute - white-space Instructions for using the white-space attribute_Experience exchange

WBOY
Release: 2016-05-16 12:07:47
Original
1621 people have browsed it

CSS property - white-space White space property description
This CSS property is used to handle white space.

Values: normal | pre | nowrap | inherit

Available values Value description
normal Default value. Text wraps naturally. If it exceeds the width of the element, the content will naturally wrap to the next line.
nowrap does not allow line breaks.
pre preserves line breaks and whitespace. This value is only supported by IE 6 or above if you declare !DOCTYPE.



In HTML files, whitespace, such as line breaks, spaces, and tabs, are automatically truncated. HTML will automatically cut off extra spaces. No matter how many spaces you add, they are all counted as one space. To add spaces to a web page, you can use " to represent spaces. You can also use
to force line breaks.

Example code
.p1 {white-space: nowrap}
.p2 {white-space: normal}
Inheritance
is

applicable
All block elements.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!