Tips for implementing Wordwrap on List Items within a Flexbox Setup

Here's a current look at the elements related to my query: Flexbox Layout

I'm aiming to have the text inside the unordered-list elements wrap to the next line if it's too long. Currently, the entire list moves to a new line (refer to the 2nd example in the linked image).

My goal is to keep the list right beside the image on the same row (unless a media query triggers flex-direction: column).

Any suggestions for 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>Driving instructor since: 1964</li>
    <li>self-employed since: 1968</li>
    <li>other: Founded Fahrschule Niepel on 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>Driving instructor since: 1983</li>
    <li>at Fahrschule Niepel since: 1983</li>
    <li>other: Since 2001, I have been managing our office and I am the contact person for all questions regarding your training.</li>
  </ul>
</div>

Answer №1

Include flex: 1; in the styling for .team-description.

By doing this, you will establish the following:

flex-grow: 1;
flex-shrink: 1;
flex-basis: 0%;

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What are the best ways to customize exported and slotted components in Svelte?

Is there a similarity between Svelte slots and vanilla-js/dom functionality (I'm having trouble with it). In html/js, I can achieve the following: <style> body {color: red;} /* style exposed part from outside */ my-element::par ...

Troubleshooting the problem of divs overlapping when scrolling in JavaScript

I am experiencing some issues with full screen divs that overlay each other on scroll and a background image. When scrolling back to the top in Chrome, the background shifts down slightly, and in Safari, the same issue occurs when scrolling down. I have cr ...

Using WebRTC on a shared hosting environment (with SSH access) without the need for nodejs, ideally implemented in PHP

As I was exploring ways to integrate webRTC into a website that I am creating on shared hosting, I stumbled upon this GitHub repository by nielsbaloe. It has been incredibly helpful in establishing a basic connection. This particular code snippet appears ...

Are CSS3 animations limited to working only with Webkit?

Trying to create a CSS3 animation featuring a puzzle piece on my website. Below is the code I'm using. Strangely, the animation only seems to be working on Safari and Chrome. Any tips on how to make it compatible with Firefox and Opera? Appreciate you ...

MySQL unable to access information entered into form

After creating a new log in / register template using CSS3 and HTML, I now have a more visually appealing form compared to the basic one I had before. To achieve this look, I referenced the following tutorial: http://www.script-tutorials.com/css 3-modal-po ...

The infamous IE7 Bug Caused by CSS HasLayout

Initially, I've reviewed the following articles in order to refresh my knowledge on these topics as I have encountered them before: Position Relative / Absolute / Fixed in IE While the above resources may be helpful for individuals facing these issu ...

What is the best way to call a JavaScript function within a PHP echo statement that outputs a <div> element?

Having trouble echoing this PHP code due to issues with single quotes, causing the HTML to end prematurely. Any suggestions on how to fix this? function button($conn){ $sql = "SELECT * FROM table"; $result= mysqli_query($conn, $sql); while($r ...

Troubleshooting Bootstrap Social Buttons: Background Color and Hovering Challenges

I've been working with Bootstrap to design social buttons for Facebook and LinkedIn. However, I'm facing an issue where setting the background color to white for the buttons doesn't cover them properly. The white background extends beyond th ...

What measures can be taken to restrict users from inputting decimal values?

My website includes an order page where users can input quantities for various items. While some items allow for decimal quantities, others do not. What is the most effective method to restrict users from entering decimal quantities? (Besides using an ale ...

Align text to the center within the dropdown menu for all web browsers

Is it possible to center align text in a select drop down for all browsers? It appears centered in Firefox, but shifts to the left in Chrome and Safari. CSS: .challenge{ max-width: 850px; width: 98%; height: 50px; background: #ffffff; margin: 3 ...

Java Spring - The on-page styling is out of control

Currently, I am in the process of developing a taxi web application using Java Spring. After successfully creating the website with the help of a template, I encountered an issue when trying to integrate the login functionality. Strangely, the styling on ...

Tips for troubleshooting a sass file that is not displaying changes in the browser

Currently working on my portfolio website using bootstrap and sass along with a theme kit. Initially, I attempted to implement a grid column style for the intro-section but had a change of heart and deleted the style. Surprisingly, every time I refresh my ...

Converting HTML Form Data into CSV with Multiple Rows

I currently have a form that generates a CSV file with data from select elements in the HTML form. The columns in the CSV correspond to the selected options in the form, but I need to extend this functionality to populate multiple rows in the CSV. Expecte ...

No input value provided

I can't figure out what's going wrong. In other js files, this code works fine. Here is my HTML code: <table class='table'> <tr> <th>Event</th><td><input class='for ...

Creating a responsive grid layout with HTML and CSS

Is there a way to adjust the grid layout so that the second row of blocks align just below the corresponding block above instead of creating an entirely new row? http://jsfiddle.net/AndyMP/wSvrN/ body { margin-left: 0px; margin-top: 0px; marg ...

CSS: Maintain rounded corners on body border even when scrolling

I am attempting to create a body border on my webpage with rounded corners at the top to simulate the MacOS interface in the browser, similar to the image shown here: https://i.sstatic.net/ECSU9.jpg The issue arises when I scroll, and the top corners van ...

Position an HTML canvas at the very top of the webpage

Can someone help me figure out how to align a canvas element to the very top (0, 0) of a webpage? I attempted using margin: 0; padding: 0px;, but it didn't work. There always seems to be some white space at the top that I can't eliminate. ...

Google Fonts are displaying in a bold style even when the bold property is not set

I need assistance with an issue involving emails going from Salesforce to Outlook 365. Here is the HTML code snippet: <link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css"> <style> body ...

Mozilla Firefox does not have the capability to support preloading

I am having an issue with preloading CSS sheets. I attempted to preload the CSS sheet using the preload attribute in HTML. It works fine on Google Chrome, but unfortunately, it does not work on Firefox. <head> <link href=assets/css/master.c ...

Tips for safeguarding registration forms against spamming

The ASP.NET/Mono MVC2 E-shop includes a registration form that requests mandatory customer name, address, phone password (entered twice) and some optional fields. Should we add spam protection to the form? The current setup verifies that the password and ...