![]() It only works in combination with the display property set to -webkit-box or -webkit-inline-box and the -webkit-box-orient property set to vertical. Usage of Global 96.56 unprefixed: 0. It will end with ellipsis when text-overflow: ellipsis is included. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. webkit-line-clamp - CSS - W3cubDocs -webkit-line-clamp The -webkit-line-clamp CSS property allows limiting of the contents of a block container to the specified number of lines. SeptemNew feature: ImageCapture API Feature: CSS line-clamp CSS line-clamp - WD CSS property that will contain text to a given amount of lines when used in combination with display: -webkit-box. The is a very common and widely used scenario and it has a standard CSS implementation.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Truncating single line text followed by an ellipsis For my use, the -webkit-line-clamp method looked the best, but I needed a decent fallback for non-webkit browsers. The -webkit-line-clamp property is used to limit the amount of lines that a block container may contain. There a JavaScript solution might be ideal in some cases. slds-line-clampx-small - truncates at 2 lines of content. ![]() SLDS supports four different line clamp limits: slds-line-clamp - truncation is determined by a token, default will truncate at 3 lines of content. default: false ellipsis. ![]() This snippet takes a guess at a suitable max-height for when line-clamp is in use - it needs to be larger than 2 lines high so that the line-clamp can work. If you dont want to use css clamp, set disableCssClamp to true. As you cant animate line-clamp (or display) we have to find something animatable but which will nonetheless show exactly two lines in the non-hovered state. Truncating multiple line text using pure CSS can be done, however, it has some caveats. When applied to text-based elements, Line Clamp allows for configurable multi-line text truncation. React-multi-clamp will use native css clamp(-webkit-line-clamp) in supported browser when the ellipsis is set to.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |