Tom Usborne The WordPress editor will "clean" up your code/content added in the visual editor. This includes extra spaces, empty elements () etc..
It can be annoying, but can also be very helpful.
If you want to add empty lines, you can add an HTML comment inside your empty elements:
<!-- empty element -->