There was a mistake in the code on the other thread in that the closing " for <div id="boxContainer">
Here is how it would look with four "boxes" delineated by the different colors.
Code:
<div id="boxWrapper">
<div id="boxContainer">
<div class="boxItem">
WHATERVER YOU WANT IN THE BOX
</div>
<div class="boxItem">
SECOND ITEM IN THE BOX
</div>
<div class="boxItem">
THIRD ITEM IN THE BOX
</div>
<div class="boxItem">
YOU GET THE IDEA
</div>
</div>
<div id="boxContainer">
<div class="boxItem">
WHATERVER YOU WANT IN THE BOX
</div>
<div class="boxItem">
SECOND ITEM IN THE BOX
</div>
<div class="boxItem">
THIRD ITEM IN THE BOX
</div>
<div class="boxItem">
YOU GET THE IDEA
</div>
</div>
<div id="boxContainer">
<div class="boxItem">
WHATERVER YOU WANT IN THE BOX
</div>
<div class="boxItem">
SECOND ITEM IN THE BOX
</div>
<div class="boxItem">
THIRD ITEM IN THE BOX
</div>
<div class="boxItem">
YOU GET THE IDEA
</div>
</div>
<div id="boxContainer">
<div class="boxItem">
WHATERVER YOU WANT IN THE BOX
</div>
<div class="boxItem">
SECOND ITEM IN THE BOX
</div>
<div class="boxItem">
THIRD ITEM IN THE BOX
</div>
<div class="boxItem">
YOU GET THE IDEA
</div>
</div>
<br>
</div>
The following CSS will give you four across, three across, two across or in a single line depending on the width of the screen.
Code:
#boxWrapper(text-align:center;}/* Lines all the items in the box up nicely. */#boxContainer{display:flex;flex-flow: row wrap;justity-content:space-evenly;}/* Tells the container we'll be wanting it to adjust to the items we place in it. */
#boxItem{order: 0;flex: 0 1 auto;align-self: flex-start;padding:10px;box-sizing: border-box;min-width:200px;max-width:225px;}/* defines each box. Padding and width are "adjust as required" */
#boxContainer br<clear:both;}/* Just to keep the right-hand column from jumping in where it doesn't belong. */
If the only thing in each "box" is an image, it would look like the following with the single image taking the place of all the "items" in the "box".
Code:
<div id="boxWrapper">
<div id="boxContainer">
<img src="img_girl.jpg" alt="Girl in a jacket" />
</div>
<div id="boxContainer">
<img src="img_boy.jpg" alt="Boy in a jacket" />
</div>
<div id="boxContainer">
<img src="img_woman.jpg" alt="Woman in a jacket" />
</div>
<div id="boxContainer">
<img src="img_man.jpg" alt="Man in a jacket" />
</div>
<br>
</div>
And, the CSS would look like
Code:
#boxWrapper(text-align:center;}/* Lines all the items in the box up nicely. */#boxContainer{display:flex;flex-flow: row wrap;justity-content:space-evenly;}/* Tells the container we'll be wanting it to adjust to the items we place in it. */
#boxContainer img{order: 0;flex: 0 1 auto;align-self: flex-start;padding:10px;box-sizing: border-box;min-width:200px;max-width:225px;}/* defines each image. Padding and width are "adjust as required" */
#boxContainer br<clear:both;}/* Just to keep the right-hand column from jumping in where it doesn't belong. */
Bookmarks