WordPress - Keep slider size, but keep the middle part in the center at any screen size

If your slider size is 1920px*500px, then you could use this code in your post or page with your slider’s id:

<div style="height:500px; width:100%; position:relative; overflow:hidden;">
	<div style="width:1920px; position:absolute; top:0; left:50%; margin-left:-960px;">
		[smartslider2 slider="5"]
	</div>
</div>

or in your php code:

<div style="height:500px; width:100%; position:relative; overflow:hidden;">
	<div style="width:1920px; position:absolute; top:0; left:50%; margin-left:-960px;">
		<?php
		echo do_shortcode('[smartslider2 slider="5"]');
		?>
	</div>
</div>

The div with the relative position would keep the space for the slider, and the div with the absolute position would keep the center of the slider in the middle. You should change the height:500px; and the width:1920px; to the size of your slider, and the margin-left:-960px; where the 960 = 1920 / 2