HTML/CSS/Text/white space
Содержание
white-space: normal
<source lang="html4strict">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html>
<head> <title></title> <style type="text/css"> p { font-family: monospace; white-space: normal; } </style> </head> <body>
This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test.
</body>
</html>
</source>
white-space: nowrap
<source lang="html4strict">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html>
<head> <title></title> <style type="text/css"> p { font-family: monospace; white-space: nowrap; } </style> </head> <body>
This is a test. This is a test. This is a test. This is a test.
</body>
</html>
</source>
white-space: nowrap, white-space: pre
<source lang="html4strict">
<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head>
<title>CSS Example</title> <style rel="stylesheet" type="text/css">
body {
color: #000000; background-color: #ffffff; font-family: arial, verdana, sans-serif; font-size: 12px;
} .pre {
white-space: pre;
} .nowrap {
white-space: nowrap;
} </style> </head> <body>
white-space
this is a test. this is a test. .
this is a test. this is a test.
CSS.
</body> </html>
</source>
white-space: pre
<source lang="html4strict">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html>
<head> <title></title> <style type="text/css"> p { font-family: monospace; white-space: pre; } </style> </head> <body>
This is a test. This is a test.
</body>
</html>
</source>