
[CSS] 텍스트 '...' 처리하는 방법 (한 줄/여러 줄)
Style sheet/CSS
2023. 8. 2. 17:33
CSS를 이용하여 텍스트가 한 줄일 때는 '...'으로 보이게 하고, 여러 줄일 때는 지정한 줄 수 이후에 '...'으로 보이게 하는 방법에 대해 설명드리겠습니다. This is a long text that will be truncated with an ellipsis when it exceeds one line. This is a longer text that will be truncated with an ellipsis after three lines when it exceeds the specified line count. 위의 코드에서는 CSS를 이용하여 각각의 클래스를 정의하였습니다. .ellipsis-one-line: 한 줄일 때는 white-space: nowrap을 사용하여 줄 바꿈을 방..