I have an issue where I have a flexbox, but I don't exactly want every single element to be spaced according to the properties given, so I want to play with margins.
I have a header at the top of the box but I want spacing between it and the rest of the elements.
So I want my list of p
elements to be grouped together but spaced farther away from the heading.
However, when I do margin-bottom
it isn't having an effect (when I increase or decrease margin-bottom
nothing changes).
I was originally doing it in percents and changed it to pixels but that doesn't seem to be the issue either.
In the snippet I would have no problem with how it looks but on a bigger browser there's hardly any space between the heading and the p
elements which is the issue.
.container {
display: flex;
position: relative;
flex-wrap: wrap;
justify-content: flex-start;
align-items: stretch;
min-height: 70vh;
width: 70%;
margin: 5% auto 8% auto;
background-color: white;
}
.container p {
margin-bottom: 2%;
}
.container h2 {
color: orange;
font-size: 34px;
}
.middle p:first-child {
margin-top: 8%;
}
.bspace {
margin-bottom: 50px;
}
.box h2 {
color: orange;
text-align: center;
}
.left {
display: flex;
flex-flow: row wrap;
align-items: center;
justify-content: space-around;
order: 1;
width: 30%;
}
.middle {
display: flex;
flex-flow: column wrap;
order: 2;
width: 45%;
height: 100%;
}
<div class="container">
<div class="left">
<img src="home.jpg" alt="Picture of kid">
<img src="catering.jpg" alt="Picture of kid">
</div>
<div class="middle">
<h2 class="bspace"> Some Text </h2>
<p>Sample</p>
<p>Sample</p>
<p>Sample</p>
<p>Sample</p>
</div>
</div>