CSS Snippets

The CSS snippet collection contains utilities and interactive examples for CSS3. It includes modern techniques for creating commonly-used layouts, styling and animating elements, as well as snippets for handling user interactions.

  • Donut spinner

    Creates a donut spinner that can be used to indicate the loading of content.

    CSS, Animation · Oct 13, 2021

  • Drop cap

    Makes the first letter of the first paragraph bigger than the rest of the text.

    CSS, Visual · Dec 30, 2020

  • Tip: CSS easing variables

    Learn how to use the cubic-bezier() class of easing functions and create beautiful animations that stand out.

    CSS, Animation · Jun 12, 2021

  • Etched text

    Creates an effect where text appears to be "etched" or engraved into the background.

    CSS, Visual · Dec 30, 2020

  • Evenly distributed children

    Evenly distributes child elements within a parent element.

    CSS, Layout · Oct 13, 2021

  • Flexbox centering

    Horizontally and vertically centers a child element within a parent element using flexbox.

    CSS, Layout · Dec 30, 2020

  • Full-width image

    Creates a full-width image.

    CSS, Layout · Jan 7, 2021

  • Grid centering

    Horizontally and vertically centers a child element within a parent element using grid.

    CSS, Layout · Dec 30, 2020

  • What's the difference between :root and html in CSS?

    The CSS selectors used to target the root element of an HTML share some similarities, but they also have some differences.

    CSS, Layout · May 22, 2022

  • Tip: Style links without a class

    A short summary of your story up to 180 characters long.

    CSS, Visual · Nov 23, 2022

  • Truncate text

    Truncates text that is longer than one line, adding an ellipsis at the end ().

    CSS, Layout · Dec 30, 2020

  • Zoom in zoom out animation

    Creates a zoom in zoom out animation.

    CSS, Animation · Oct 13, 2021

  • Constant width to height ratio

    Ensures that an element with variable width will retain a proportionate height value.

    CSS, Layout · Dec 30, 2020

  • Disable selection

    Makes the content unselectable.

    CSS, Interactivity · Dec 30, 2020

  • Tip: The perfect duration for CSS transitions

    Learn how to make your CSS transitions feel perfect when users interact with elements on the page with this simple tip.

    CSS, Interactivity · Jun 12, 2021