ellipsis2 [css] ellipsis with flexible width export const Wrapper = styled.div` display: flex; width: 200px; `; export const Flex1Div = styled.div` flex: 1; `; export const Content = styled.div` white-space: nowrap; text-overflow: ellipsis; overflow: hidden; & > * { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } `; --------------------------------------------------------------------------------------------------------- 2023. 4. 27. How to detect text overflow ellipsis? Search:: how to check if html element is in ellipsis HTML text-overflow ellipsis detection Try this JS function, passing the span element as argument: function isEllipsisActive(e) { return (e.offsetWidth < e.scrollWidth); } @NicolasS.Xu I believe if the element is a span, you might get zeros in these properties. So one solution is to wrap the span in a div which has overflow: hidden and then che.. 2023. 1. 9. 이전 1 다음