div {
    width: 200px;
    border: 2px solid red;

    /* Required properties to prevent wrapping 
       and display an ellipsis (...) */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
<div>
    This example demonstrates how to prevent automatic line breaks,
    hide overflowing text, and display an ellipsis (...)
    when the text reaches the end of the content box.
</div>
Rendered Output
<div>
    The text-overflow property specifies
    whether an ellipsis (...) is displayed to signal to the user 
    that single-line text has overflowed
    the element's box and is hidden from view.
</div>
div {
    width: 200px;
    border: 2px solid red;
}
Rendered Output
<div style="white-space: nowrap;">
    The text-overflow property specifies
    whether an ellipsis (...) is displayed to signal to the user 
    that single-line text has overflowed
    the element's box and is hidden from view.
</div>
Rendered Output
<div style="white-space: nowrap; overflow: hidden;">
    The text-overflow property specifies
    whether an ellipsis (...) is displayed to signal to the user 
    that single-line text has overflowed
    the element's box and is hidden from view.
</div>
Rendered Output
<div style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
    The text-overflow property specifies
    whether an ellipsis (...) is displayed to signal to the user 
    that single-line text has overflowed
    the element's box and is hidden from view.
</div>
Rendered Output
div {
    max-width: 200px;
    border: 2px solid red;

    /* Required CSS to limit text to specified lines 
       and display an ellipsis (...) */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 3; /* Number of lines to display */
}
<div>
    The -webkit-line-clamp property restricts a text block to a specified number of lines. 
    This property functions when the display property of the element is set to -webkit-box 
    and the -webkit-box-orient property is set to vertical. 
    If the text exceeds the specified number of lines, an ellipsis (...) is displayed. 
    When the overflow property of the element is set to a value other than visible, 
    the text is truncated to the specified number of lines;
    otherwise, the text continues to be displayed even after the ellipsis appears.
</div>
Rendered Output
div {
    max-width: 400px;
    border: 2px solid red;
    overflow: visible;
    -webkit-line-clamp: 2;
    /* display: -webkit-box and 
       -webkit-box-orient: vertical are not applied here. */
}
<div>
    The -webkit-line-clamp property restricts a text block to a specified number of lines. 
    This property functions when the display property of the element is set to -webkit-box 
    and the -webkit-box-orient property is set to vertical. 
    If the text exceeds the specified number of lines, an ellipsis (...) is displayed. 
    When the overflow property of the element is set to a value other than visible, 
    the text is truncated to the specified number of lines;
    otherwise, the text continues to be displayed even after the ellipsis appears.
</div>
Rendered Output
div {
    max-width: 400px;
    border: 2px solid red;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    
    /* The text continues to be displayed 
       even after the ellipsis (...) appears. */
    overflow: visible;
}
<div>
    The -webkit-line-clamp property restricts a text block to a specified number of lines. 
    This property functions when the display property of the element is set to -webkit-box 
    and the -webkit-box-orient property is set to vertical. 
    If the text exceeds the specified number of lines, an ellipsis (...) is displayed. 
    When the overflow property of the element is set to a value other than visible, 
    the text is truncated to the specified number of lines;
    otherwise, the text continues to be displayed even after the ellipsis appears.
</div>
Rendered Output