Weil's so schön ist, hier nochmal ne Lösung für dich ohne extra Container
PHP-Code:
.flexbasic {
display: flex;
flex-wrap: wrap;
/* justify-content: space-between; */
margin: 0 -10px;
/* width: 100%; */
}
.hellblauflex {
/* min-height: 200px; */
flex-basis: calc(75% - 20px);
/* flex-grow: 4; */
/* margin: 0px; */
/* margin-bottom: 5px; */
padding: 20px;
background-color: rgba(120,248,255,0.2);
border: 1px solid #0696b0;
border-radius: 10px;
/* -moz-border-radius: 10px; */
/* -khtml-border-radius: 10px; */
/* -webkit-border-radius: 10px; */
box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, .2);
margin: 10px;
}
.hellgruenflex {
/* min-height: 200px; */
flex-basis: calc(25% - 20px);
/* flex-grow: 1; */
border: 1px solid #008e5c;
background-color: rgba(166,210,198,0.2);
padding: 20px;
/* margin: 0px; */
/* margin-bottom: 5px; */
border-radius: 10px;
/* -moz-border-radius: 10px; */
/* -khtml-border-radius: 10px; */
/* -webkit-border-radius: 10px; */
box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, .3);
margin: 10px;
}
/* breakpoint */
.hellblauflex,
.hellgruenflex {
flex-basis: calc(100% - 20px);
}
Auf's Wesentliche reduziert sieht das also so aus
PHP-Code:
.flexbasic {
display: flex;
flex-wrap: wrap;
margin: 0 -10px; /* gutter 20px */
}
.hellblauflex {
flex-basis: calc(75% - 20px); /* gutter 20px */
padding: 20px;
margin: 10px; /* gutter 20px */
}
.hellgruenflex {
flex-basis: calc(25% - 20px); /* gutter 20px */
padding: 20px;
margin: 10px; /* gutter 20px */
}
/* breakpoint */
.hellblauflex,
.hellgruenflex {
flex-basis: calc(100% - 20px);
}
Ich würde dir auch empfehlen den Flex-Container außerhalb der CEs vom Typ Text zu setzen
HTML-Code:
<!-- alt -->
<div class="ce_text flexbasic block">
<div class="hellblauflex">
<div class="hellgruenflex">
</div>
<!-- neu -->
<!-- CE HTML -->
<div class="flexbox">
<!-- CE text -->
<div class="ce_text col-75 hellblau">
<!-- CE text -->
<div class="ce_text col-25 hellgruen">
<!-- CE HTML -->
</div>
Wenn die Flex-Items die einzigen CEs sind, kannst du auch direkt den Artikel als Flex-Container benutzen und diesem die Klasse "flexbox" geben.
Lesezeichen