I'm currently tackling a project that prioritizes mobile-first design. While I have a list of elements to work with, I've encountered an issue with one in particular. In this project, I want the "h3" element to always be fully visible for easy reading by customers. On the other hand, I'd like the "meal__description" to be cropped if it exceeds a certain length, ensuring that the price remains within its designated box without any unwanted shifts. Despite attempting to adjust the width of the element, it seems to be interfering with my hover effect. Thank you in advance for any assistance you can offer!
h3 {
font-size: 18px;
margin: 0;
font-weight: 600;
width: 100%;
}
.meal .meal__block {
display: flex;
justify-content: space-between;
background-color: white;
border-radius: 1rem;
box-shadow: 0 0 10px #0000002e;
margin-bottom: 2rem;
height: 4rem;
position: relative;
padding-left: 0.8rem;
padding-top: 1rem;
animation: fadeIn 0.7s ease-in both, top 0.5s linear;
cursor: pointer;
}
.meal__description {
margin-top: 10px;
}
.meal__price {
font-weight: bold;
padding-right: 1rem;
padding-top: 1.1rem;
}
.meal .meal__text h3,
.meal__description {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.meal__description {
font-size: 17px;
width: 100%;
}
... (additional CSS code) ...
<div class="meal">
<section>
....
The sample HTML code continues here...