So I'm working on a project that involves cloning some objects and appending them to the same parent, I then animate these objects but my calculations always seemed to be off, and I realized it's because inline-block items always have trailing space, which would be fine but when I append a cloned item using jQuery to the parent div that trailing space isn't included which leaves things very inconsistent and difficult to work with.
When inspecting the elements using browser tools, the elements claim to be identical, setting margins and padding make no difference, is this a bug or am I just missing something? Below is a simple demo to replicate the results
https://jsfiddle.net/kd5opn7j/2/
$('ul').find('li').each(function(){
$('ul').append($(this).clone());
});
li {
display: inline-block;
width:50px;
height:50px;
background: #555;
}
<ul>
<li></li>
<li></li>
<li></li>
</ul>