White space property between blocks

Is the CSS white space property supposed to affect spaces between block elements?

For example, in the document used as an example in Whitespace in the DOM, "as follows, between and <p>:

<!-- My document -->
<html>
<head>
  <title>My Document</title>
</head>
<body>
  <h1>Header</h1>
  <p>
    Paragraph
  </p>
</body>
</html>

This space is usually removed; for example, the XHTML specification says that the corresponding user agent must meet all of the following criteria :

, 'xml: space' "" , ( , ). :

  • .
  • .
  • ( , "xml: space" "" ).
  • ( , "xml: space" "" ).

:

  • CSS <body>, (, </h1> <p>)? , white-space ?

  • XHTML , a <body> PCDATA (.. ). , ( ), <body> / CSS? </h1> <p> , <body>, / - , <div style="white-space: pre"> <body> ?

  • " " " , ( ) " . ( )?

  • ( , ) ? , <p>The <strong> lazy </strong> dog.</p> <strong>? ( HTML 4 ; , , - /// XHTML CSS.)

+3
1

. , .

XHTML : preserve:

  • STYLE
  • SCRIPT
  • PRE

, . Mozilla ( " DOM" ):

Mozilla DOM...

. ( -: - ) , " " HTML . , , (HTML).

IE8 ( , F12 , CTRL - G). 100% , , Firefox. HTML, ( ). SCRIPT STYLE elements <<20 > , . . DIV ( ) .

, Firefox IE8 .

, white-space (, , JavaScript/jQuery, ). white-space , (, white-space: nowrap ).

+1

Source: https://habr.com/ru/post/1752958/


All Articles