<div class="section-wrapper">
<section class="section">
<div class="section__item section__item--start">
<h2>Sign up now</h2>
<p>We're glad that you want to know more about our business.
</p>
</div>
<div class="section__item section__item--end">
<ul>
<li>100% free account.</li>
<li>No ads.</li>
<li>Cancel at anytime, no questions asked.</li>
</ul>
</div>
</section>
</div>
.section-wrapper {
container-type: inline-size;
resize: horizontal;
overflow: hidden;
max-width: 800px;
margin: 1rem auto;
}
.section {
display: flex;
flex-direction: column;
gap: 1rem;
padding: 1rem;
&:before {
content: "";
align-self: stretch;
border: 1px solid lightgrey;
}
}
@container (inline-size >= 600px) {
.section {
flex-direction: row;
align-items: center;
}
}
.section__item {
flex: 1;
min-width: 0;
overflow-wrap: break-word;
}
.section__item--start {
order: -1;
}
p {
color: #222;
}
*,
*:before,
*:after {
box-sizing: border-box;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.