I drew the problem so you can better understand it:

So, the question – is it possible to get the same position for both blue elements?
I can’t just add “padding-right” – in different OS/Browsers scrollbars can have different widths…
Is it possible to do with css?
If not, is there a JavaScript solution to get the scrollbar element’s width and center blue elements manually?
You could add a invisible wrapper around the blue box that takes up all the space in the parent minus the width of the scroll bar. That would make the blue box the same size as in Container 2 all the time.