Reputation: 282
Here is how the elements according to my question look like at the moment: Flexbox Layout
What I want to achieve is, that the text inside the unordered-list elements is wrapped to the next line if it's too long. What happens now is, that the whole list jumps into a new line (see the 2nd example in the linked image).
I want the list to stay right next to the image on the same row (until some media query is reached to break with flex-direction: column
).
Any possible solutions?
.team-row {
display: -webkit-flex;
/* Safari */
-webkit-flex-flow: row wrap;
/* Safari 6.1+ */
display: flex;
flex-flow: row wrap;
margin-top: 1em;
border: 1px solid #efefef;
padding: 5px;
}
.team-header {
padding: 8px;
background-color: #F6B80B;
width: 100%;
}
<div class="team-row">
<strong class="team-header">Wolfgang Niepel</strong>
<img class="team-image" src="http://wp.fahrschuleniepel.de/wp-content/uploads/2018/09/image.png" alt="Wolfgang Niepel" width="100" height="133">
<ul class="team-description">
<li>Fahrlehrer seit: 1964</li>
<li>selbstständig seit: 1968</li>
<li>sonstiges: Gründung der Fahrschule Niepel am 01.12.1968.</li>
</ul>
</div>
<div class="team-row">
<strong class="team-header">Jens Niepel</strong>
<img class="team-image" src="http://wp.fahrschuleniepel.de/wp-content/uploads/2018/09/jens_niepel_100.jpg" alt="Jens Niepel" width="100" height="133">
<ul class="team-description">
<li>Fahrlehrer seit: 1983</li>
<li>bei Fahrschule Niepel seit: 1983</li>
<li>sonstiges: Seit 2001 leite ich unser Büro und bin Ihr Ansprechpartner zu allen Fragen rund um Ihre Ausbildung.</li>
</ul>
</div>
Upvotes: 1
Views: 40
Reputation: 269
Add flex: 1;
to .team-description
.
This will set:
flex-grow: 1;
flex-shrink: 1;
flex-basis: 0%;
Upvotes: 1