I am currently making adjustments to a CSS template that is based on bootstrap, with the goal of creating a responsive and simple website.
The webpage displays a list of events. When viewed on a smartphone (smaller screen), the flex-row
class allows show_name
and show_location
to be arranged in a column layout for space-saving purposes due to the fixed width of show_date
and show_shop
.
An issue arises when the text in show_name
and show_location
exceeds the available space, causing it to wrap vertically outside of their designated boxes.
Is there a way to restrict the text in show_name
and show_location
to only one line each, truncating excess text with an ellipsis (...
)?
I attempted using overflow: hidden
along with text-overflow: ellipsis
but this proved ineffective, possibly due to the flexible width of the division.
Thank you in advance for any assistance with this matter.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1c7e7373686f686e7d6c5c28322a322d">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous">
<div class="col-lg-8 order-lg-1 order-2 shows_list_col">
<div class="shows_list_container">
<ul class="shows_list">
<li class="d-flex flex-row align-items-center justify-content-start">
<div>
<div class="show_date">18/07</div>
</div>
<div class="show_info d-flex flex-md-row flex-column align-items-md-center align-items-start justify-content-md-start justify-content-center">
<div class="show_name"><a href="#">Electric Castle Festival</a></div>
<div class="show_location">Cluj, Romania</div>
</div>
<div class="ml-auto">
<div class="show_shop trans_200"><a href="#">Buy Tickets</a></div>
</div>
</li>
<li class="d-flex flex-row align-items-center justify-content-start">
<div>
<div class="show_date">20/07</div>
</div>
<div class="show_info d-flex flex-md-row flex-column align-items-md-center align-items-start justify-content-md-start justify-content-center">
<div class="show_name"><a href="#">Ultra Music Festival</a></div>
<div class="show_location">Miami, USA</div>
</div>
<div class="ml-auto">
<div class="show_shop trans_200"><a href="#">Buy Tickets</a></div>
</div>
</li>
<li class="d-flex flex-row align-items-center justify-content-start">
<div>
<div class="show_date">25/08</div>
</div>
<div class="show_info d-flex flex-md-row flex-column align-items-md-center align-items-start justify-content-md-start justify-content-center">
<div class="show_name"><a href="#">Vikings Festival</a></div>
<div class="show_location">Oslo, Norway</div>
</div>
<div class="ml-auto">
<div class="show_shop trans_200"><a href="#">Buy Tickets</a></div>
</div>
</li>
</ul>
</div>
</div>