30秒学会 CSS 片段 – Aspect ratio
Creates a responsive container with a specified aspect ratio. Use a CSS custom property, –aspect-ra...
Creates a responsive container with a specified aspect ratio. Use a CSS custom property, –aspect-ra...
Limit multiline text to a given number of lines. Use -webkit-line-clamp to set the maximum number of...
Creates a responsive layout with a content area and a sidebar. Use display: grid on the parent conta...
Creates a full-width image. Use left: 50% and right: 50% to position the image in the middle of the ...
Creates a responsive image mosaic. Use display: grid to create an appropriate responsive grid layout...
假定元素的宽度可变,它的高度会自动适应 (比如其 width 和 height 可以保持固定的宽高比). 在伪元素 :before 上设置 padding-top 可以使元素的高度与宽度成一定的比例。...
Vertically and horizontally centers a child element within its parent element using position: absolu...
If the text is longer than one line, it will be truncated and end with an ellipsis …. overflow: hidd...
Evenly distributes child elements within a parent element. display: flex enables flexbox. justify-co...
Vertically and horizontally centers a child element within its parent element using display: table (...