I noticed some weird behavior in Chrome / FF / IE and wondered if anyone knew why HTML / CSS gets rendered this way.
If you have an absolutely positioned child div whose parent screen is set to an inline block, any free space in the child div is considered a line break. This is true even if the child is set to contenteditable = "true" (when you try to enter spaces, it causes a line break).
Here is the scenario of the phenomenon: http://jsfiddle.net/cnPAG/1/
HTML:
<div id="container"> <div id="content">Hello, World!</div> </div>
CSS
#container { display: inline-block; position: relative; } #content { position: absolute; }
If you either eliminate the fact that it is absolutely positioned or the fact that the parent is an inline block, the problem is fixed.
html css css-position absolute relative
Camden reslink
source share