Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1617

css flex wrap with fixed_width & centered on page & left justified elements [duplicate]

$
0
0

this is NOT a duplicate question because I need the elements to be divs

I would like container to have a max-width of 800px I would like there to be no spaces & each box be 250px & centered & wrapped (justify left)

    |-  centered -|--->[box][box][box]<------>[box][box]     <---

or

      |-center-|----->[box][box]<---------->[box][box]<---------->[box]     <-----

or

-------->[box]<---------------->[box]<---------------->[box]<---------------->[box]<---------------->[box]<--------

so far I have

#container {    display: flex;    flex-wrap: wrap;    max-width: 800px;    align-content: flex-start;    justify-content: center;}#container > .box {    position: relative;    width: 250px;    height: 300px;    border: red solid thick;}<div id="container"><div class="box">a</div><div class="box">b</div><div class="box">c</div><div class="box">d</div><div class="box">e</div></div>

which centers the leftover boxes on the last row (i would like them LEFT justified).

the other similar questions don't use div elements and I need these to be divs (not li or ul)


Viewing all articles
Browse latest Browse all 1617

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>