I have the folloowing html code and the container is displayed to the left of the page. How do I center the slide show display?
<html>
<head>
<style>
.container{
position:relative;
top: 300px; // 100px from top relative to its old position
left: 600px; // 100px from left
width:50%;
height:400px;
border-radius:5px;
overflow:hidden;
}
</style>
</head>
<body>
<div id="imgGallary" class="container">
<img src="c\websites\test\1.jpg" alt="" width="50%" height="400" />
<img src="c:\websites\test\2.jpg" alt="" width="50%" height="400" />
<img src="c:\websites\test\3.jpg" alt="" width="50%" height="400" />
<img src="c:\websites\test\1.jpg" alt="" width="50%" height="400" />
</div>
<script>
(function(){
var imgLen = document.getElementById('imgGallary');
var images = imgLen.getElementsByTagName('img');
var counter = 1;
if(counter <= images.length){
setInterval(function(){
images[0].src = images[counter].src;
console.log(images[counter].src);
counter++;
if(counter === images.length){
counter = 1;
}
},4000);
}
})();
</script>
</body>
</html>