I need help with a design issue involving a parent div that has a fixed height, overflow hidden, and multiple child divs inside. How can I display an ellipsis after the visible child divs to indicate that there are more divs present?
Here is the code I have been working on:
.parent {
display: inline-block;
padding-left: 10px;
padding-top: 7px;
overflow: hidden;
height: 50px;
}
.child {
margin-right: 5px;
color: #fff;
border-radius: 3px;
padding: 3px 8px;
font-size: 12px;
margin-bottom: 10px;
background: red;
}
<div class="parent">
<div class="child">
first
</div>
<div class="child">
second
</div>
<div class="child">
third
</div>
<div class="child">
fourth
</div>
</div>
In this scenario, as the third and fourth child divs are hidden due to overflow, I want to display dots after the second div.
Furthermore, since the number of child divs could vary, I aim to show the dots only when the parent div overflows.