Currently, my webpage just consists of four images; two side-by-side. At the moment, they're all four off to the left side of the page and I would like to center them to the middle. I am currently using margin-top for its distance from the top of the page, so I am also using margin-left, right, etc. My elements stay in place when resizing my browser(which is what I wanted), but I can't move them to the center no matter how many times I change the left and right pixels.
body {
padding: 0px;
margin: 0px;
}
#dLand {
display: inline-block;
margin-top: 200px;
margin-left: auto;
margin-right: auto;
}
#sunset {
display: inline-block;
margin-top: 200px;
margin-left: auto;
margin-right: auto;
}
#griff {
display: inline-block;
margin-top: 5px;
margin-left: auto;
margin-right: auto;
}
#samo {
display: inline-block;
margin-top: 5px;
margin-left: auto;
margin-right: auto;
}
<div id='container'>
<img id='dLand' src='img/calidisney.jpeg' alt='Disneyland, CA' style='width: 40%'>
<img id='sunset' src='img/sunset.jpg' alt='Sunset Strip' style='width: 40%'>
<img id='griff' src='img/griffith.jpg' alt='Griffith Observatory' style='width: 40%'>
<img id='samo' src='img/samopier.jpg' alt='Santa Monica Pier' style='width: 40%'>
</div>