I'm working with a div
that contains several 210x210 pixel
images, and I want to adjust its margin from the left side. The goal is for the right side of the div
to be just a few pixels away from the images, which will have their own margin set. Strangely, the div
I'm using is extending all the way to the end of the page.
The specific div
in question has an id="thumbnails"
and is nested within another div
with an id="main"
. You can see the full code on this jsfiddle, but here's the relevant snippet:
HTML:
<div id="main">
<div id="thumbnails">
<img class="thumb" id="1" src="images/portfolio/lorem/thumbs/1.jpg">
<img class="thumb" id="2" src="images/portfolio/lorem/thumbs/2.jpg">
<img class="thumb" id="3" src="images/portfolio/lorem/thumbs/3.jpg">
<img class="thumb" id="4" src="images/portfolio/lorem/thumbs/4.jpg">
</div>
CSS:
#main {
background-color: rgba(50,50,50,0.6);
width: 100%;
height: 100%;
overflow: hidden;
}
#thumbnails {
margin-left: 300px;
margin-top: 50px;
background: rgba(50,50,50,0.6);
}
Additionally, I want the images to flow into a new row when the browser window is resized to be smaller.