4
I’m trying to make a page that contains div
in circles and which fit one below the other when the layout decrease, for example, to cell phone sizes.
With the common size I would like them to be 4 side-by-side and when decreasing they are below each other.
I read something about media queries and I’m trying to implement, but in case anyone knows and could help me with something.
I can’t leave a little space between the div
.
Follow the code I’m currently using:
.center-content {
border: solid 1px #000;
width: 100%;
}
.center-content div {
border-radius: 50%;
display: table-cell;
vertical-align: middle;
text-align: center;
width: 100px;
height: 100px;
background-color: #229922;
}
<div class="center-content">
<div>Texto</div>
<div>Texto</div>
<div>Texto</div>
<div>Texto</div>
<br/>
<div>Texto</div>
<div>Texto</div>
<div>Texto</div>
<div>Texto</div>
</div>
I didn’t know this inline-flex... Works very well on IE10+, however none of this module Flexible Box Layout works on IE9... has some parallel of this?
– Marco
It does, but then I’m pretty sure you’ll have to mess with the HTML structure.
– Miguel Angelo
Well, anyway it worked great for the rest... worth the best answer. VLW
– Marco
@Marco I updated the answer with another alternative, which uses
inline-block
. I was wrong, there will be no need to change the structure to use something better known CSS.– Miguel Angelo
I have my doubts about that
display:inline-flex
applied to children. In these flexbox, usually who receives the rule is the parent element. For example,.master { display: inline-flex; flex-flow: row wrap }
- Fiddle.– Renan Gomes