This solution is generated by ChatGPT, correctness is not guaranteed.
AI solution for CSS coding question on BFE.dev
2. truncate text in one line(with ellipsis)
.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }