Skip to content

Commit 0f43d71

Browse files
committed
Add section Miscellaneous CSS properties
1 parent f9a1a3e commit 0f43d71

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,27 @@ Example for an Atom feed:
644644
<link rel="alternate" type="application/atom+xml" title="My site name" href="https://example.com/feed.atom.xml" />
645645
```
646646

647+
## Miscellaneous CSS properties
648+
649+
Handy properties that are hard to memorize but can sometimes be very useful.
650+
651+
Property | Use | More info
652+
@layer | Organize your CSS | [MDN: @layer](https://developer.mozilla.org/en-US/docs/Web/CSS/@layer)
653+
@container | Responsive elements | [MDN: @container](https://developer.mozilla.org/en-US/docs/Web/CSS/@container)
654+
text-underline-offset: 0.25em | Set the distance between the text and the underline | [MDN: text-underline-offset](https://developer.mozilla.org/en-US/docs/Web/CSS/text-underline-offset)
655+
margin-block: 1lh | Set the margin for the top and bottom of an element | [MDN: margin-block](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-block)
656+
margin-trim: block-start | Trim the margin of an element | [MDN: margin-trim](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-trim)
657+
scroll-margin-top: 2rem | Set the scroll margin for the top of an element | [MDN: scroll-margin-top](https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-margin-top)
658+
overscroll-behavior: contain | Prevent overscroll effects | [MDN: overscroll-behavior](https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior)
659+
scrollbar-gutter: stable both-edges | Set the scrollbar gutter | [MDN: scrollbar-gutter](https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-gutter)
660+
width: fit-content | Set the width of an element to the width of its content | [MDN: width](https://developer.mozilla.org/en-US/docs/Web/CSS/width)
661+
display: contents | Remove the element from the document tree | [MDN: display](https://developer.mozilla.org/en-US/docs/Web/CSS/display)
662+
aspect-ratio: 16 / 9 | Set the aspect ratio of an element | [MDN: aspect-ratio](https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio)
663+
object-fit: cover | Specify how an image should be shown in an `img` element | [MDN: object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit)
664+
isolation: isolate | Prevent the element from being affected by the z-index of other elements | [MDN: isolation](https://developer.mozilla.org/en-US/docs/Web/CSS/isolation)
665+
content-visibility: hidden | Hide elements that are not visible on screen | [MDN: content-visibility](https://developer.mozilla.org/en-US/docs/Web/CSS/content-visibility)
666+
contain: size layout paint style | Prevent the element from affecting the layout of the page | [MDN: contain](https://developer.mozilla.org/en-US/docs/Web/CSS/contain)
667+
647668
## Checklist
648669

649670
Even when a site looks fine on first glance, it can still be broken.

0 commit comments

Comments
 (0)