I'm modifying a CSS template based on bootstrap, in order to obtain a responsive simple website.
The page provides a list of events. Since show_date
and show_shop
have fixed width, when the website is opened on a smartphone (smaller screen) the class flex-row
allows the show_name
and show_location
to be disposed in column to save space.
The problem is that when the text in show_name
and show_location
is too long, the text wrap out of the box in vertical.
How can I force the text in show_name
and show_location
to use only a single line (one for each one), truncating the text with ...
?
I tried overflow: hidden
with text-overflow: ellipsis
but it doesn't work (I think due to the flex width of the div).
Thanks for help.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/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>