<span> with "float: right" inside "white-space: pre"
The following HTML:
<div style="white-space: pre">
long time; <span style="float: right;">// know C?</span>
</div>differs in WebKit and Gecko in different ways. With WebKit, the contents of the range remain on the same line as the previous text, but with Gecko they move to a new line.
Which behavior is right and why?
+4
1 answer
I will have another attempt to answer this question ...
The preliminary directive white-spaceinterprets the space literally. Line breaks, spaces and tabs are displayed by the browser (br shortcuts are also considered line breaks). So
<div> hello
world</div>
... displayed as
hello
world
float: right , , .
Firefox , div . Chrome ( divs , , ). . .
white-space: pre ( , , ), , , , . , CSS, .
+1