jQuery remove() on element doesn't hide used space

javascript, jquery

Solution

What you are experiencing is not standard behavior. When removing element from DOM, occupied space should be also removed

Problem

I'm removing an element using `remove()` (it's a `<li>` with `display: inline;` set, although the same problem seems to exist with `display: block;`), and while the element is removed from the page the space it was occupying isn't. Is this standard behaviour and so should I be using another method instead? The `<li>` contains a form field, so I'm wanting to ideally not have this form field sent through to the server - hence using `remove()` instead of `hide()`.

Original source