In: Computer Science
what are three characters that are subject to whitespace collapsing?
What are three characters that are subject to whitespace collapsing?
The CSS Text Level 3 specification redefines the white-space property as a shorthand property for setting two new properties: white-space-collapsing, which controls the treatment of white space in the source code, and text-wrap, which determines where the browser can break lines of text. The following table summarises the correspondences between these three properties:
white-space | white-space-collapsing | text-wrap |
---|---|---|
normal | collapse | normal |
pre | preserve | none |
nowrap | collapse | none |
pre-wrap | preserve | normal |
pre-line | preserve-breaks | normal |
The white-space-collapsing property has five possible values:
collapse
causes white space to collapse
preserve
prevents white space from collapsing
preserve-breaks
causes white space to collapse but preserves new lines
discard
causes all white space to be discarded
trim-inner
causes leading and trailing blank lines to be discarded
The text-wrap property has three possible values:
normal
causes lines to be broken where necessary
none
prevents lines from breaking except where forced by new line characters or br elements
avoid
prevents lines from breaking inside an element except where there are no other possible break points in the line