1

Are there any formal rules how browsers (especially interested in Safari) treat br in/near div.

I'm a bit confused, finding that :

<div><br></div><br> gives 2 newlines

<br><div><br></div> ignores first br, and gives 1 newline

<div><br>sasd</div> br adds additiona newline

<div>sasd<br></div> br is ignored

Krizai
  • 610
  • 10
  • 18
  • Relevant: https://stackoverflow.com/a/3937571/1813169 – MTCoster Feb 19 '19 at 14:44
  • Beware margins, padding, collapsing margins, and the box model in general – j08691 Feb 19 '19 at 14:45
  • depending on your css or default css handling with browser, some elements should have padding and margin set to 0px. – pokeybit Feb 19 '19 at 14:45
  • @MTCoster For the context- I'm talking about contenteditable div, so browser puts tags by himself. I only need to know this to be able to correct;y modify these tags when necessary – Krizai Feb 19 '19 at 17:16

0 Answers0