I have a square element that measures 100 pixels in width. The overflow-x property has been applied, with a value of hidden.
My intention was for this setting to conceal any text that extends beyond the boundaries of the container, rather than allowing it to wrap to the next line. However, the text continues to drop down instead of overflowing to the right and becoming invisible.
.user_name {
width: 100px;
overflow-x: hidden;
}
<div class='user_name'>This is a test</div>
How can I achieve the desired effect of keeping the text within the container and hidden when it exceeds the width?