Usage share statistics by StatCounter GlobalStats for December, 2020. It’s gotten a little easier lately since Firefox (since version 68) has started supporting the ultra-bizarre -webkit-line-clamp soup method, which makes browser support for that pretty OK. As responsive design evolves and becomes more detailed, CSS itself is constantly evolving and giving authors more control. The specification for the CSS Grid Layout Module defined the space between grid tracks using the grid-gap property. Truncating a single line of text if is fairly straightforward.Truncating multiple lines is a bit harder. Proprietary and undocumented CSS property that will contain text to a given amount of lines when used in combination with display: -webkit-box. Using just CSS (no JavaScript or server-side dancing) is nice for the simplicity. You would have to look at using media queries to reduce the font-size at certain intervals where it starts breaking your design and creating scrollbars. Another use case for CSS functions is allow a font size to grow while ensuring it is at least a mimum size, enabling responsive font sizes while ensuring legibility. Now that we’ve got cross-browser support for the line-clamp property, I expect we’ll see a lot more of that around the web. Update: We can use the new clamp() CSS function to refactor the above code to simply: div { font-size: clamp(16px, 3vw, 32px); } see MDN: clamp() allows you to set a font-size that grows with the size of the viewport, but doesn't go below a minimum font-size or above a maximum font-size. Between December 2019 and April 2020 the browsers all added support for a new method in CSS called clamp( ). This method lets you define a minimum, a default, and a … CSS line-clamp : Visual-square. Vesa Piittinen created an alternative method to Clamp.js. Nice video from Kevin Powell. It will end with ellipsis when text-overflow: ellipsis is included. Level 4 adds new properties like text-decoration-skip-ink , text-underline-offset , and text-decoration-thickness . In fact, that’s how the demo above was done. And as we start to see it more in use, it’s worth the reminder that: Truncation is not a content strategy. We should at least offer a … Here are some notes, thoughts, and stuff I learned while watching it. Let's look at some CSS: h1 {font-size: 2rem;} h1.responsive {font-size: max (4vw, 2em, 2rem);} The font-size will at minimum be 2rems, or twice the default size of font for the page. css property: -webkit-line-clamp The line-clamp property is not supported in Internet Explorer (IE). Created & maintained by @Fyrd, design by @Lensco. History: Originally, flex-basis:auto meant "look at my width or height property". Browser support tables for modern web technologies. without scrolling. There is an exceptionally clever all-CSS way to do this posted on the Mobify blog Update: removed link, dead blog, added in the technique here. A fallback suggestion could be to use css supports to put back in the media queries or set another font-size property before so when the browser does not recognise the clamp function it falls back to a default font-size. It will end with ellipsis when text-overflow: ellipsis is included. Support data contributions by the GitHub community. Includes: `Int8Array`, `Uint8Array`, `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, `Int32Array`, `Uint32Array`, `Float32Array` & `Float64Array`, Browser support tables for modern web technologies. That element will act as an image overlay and be animated first. The clamp () CSS function clamps a value between an upper and lower bound.