<tutorialjinni.com/>

CSS Overflow Dots

Posted Under: CSS3, Snippets on Mar 5, 2021
CSS code snippet to show Dots and the end of the text, if it exceeds the width of the element. The text must be in a straight line. CSS property for this behavior is text-overflow.
.DotsCSS{
	width:70%;
	white-space: nowrap; 
	overflow: hidden;
	text-overflow: ellipsis; # Make the dots
	border: 1px solid red; #Show Boundary of container
}

text-overflow:ellipsis; Output

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.


imgae