Its_ToXiiC Its_ToXiiC - 1 year ago 109
CSS Question

Divs overlapping

So what I am trying to do is make a horizontal list, but instead of using ul and li. I trying to align divs. Here is the JSFiddle


<div class="card">
<img src="img/toxiic-logo.jpg" alt="ToXiiC Avitar" style="width: 100%" />
<div class="container">
<p>Founder and CTO</p>

Answer Source

If you want to align divs horizontally, use CSS-Flexbox.
Create a parent element containing the divs with CSS

display: flex;
flexflow: row wrap;     /* or no-wrap instead of wrap, if you want to make 100% sure, they are all in the same row, even if they don't really fit */
justify-content: space-around;

and remove the absolute positioning form .card:

position: absolute;
left: 50%;
transform: translateX(-50%);

this should do it.