I have created a simple user-controlled carousel, but with each scroll the currently-displayed section comes out of alignment by about 4.5px.
It works by collecting all the direct ancestor <section> tags inside the parent container it has hooked onto, setting display: inline-block on each <section> and making the width of each <section> the same.
The scrolling is achieved by setting the <section> container's margin-left property to negative N * W, where N is the number of <section> tags scrolled and W is the width of each <section>.
The padding and margin properties of the <section> tags and the container have been set to 0.
What could be causing this?
JSFiddle: https://jsfiddle.net/835kxb2w/ - I have added borders to the <section> tags to make the issue more apparent.
Also, in what I think is a related issue (to do with whitespace leftover from templates?), the last section breaks onto a new line. This is despite the <section> container being the exactly N * W pixels wide.
Thanks