Best of CSS Tip2024

  1. 1
    Article
    Avatar of csstipCSS Tip·2y

    Write better CSS with modern CSS

    Learn how to write better CSS with modern CSS features that can help optimize your code and reduce redundancy.

  2. 2
    Article
    Avatar of csstipCSS Tip·2y

    3D parallax effect on hover

    Explores a new concept of 3D parallax effect on hover, aiming for a better illusion using minimal CSS. The technique involves using only an <img> tag without any extra elements or pseudo-elements and keeps the CSS declarations under 15.

  3. 3
    Article
    Avatar of csstipCSS Tip·2y

    Get the screen width & height without JavaScript

    Learn how to obtain screen width and height as pixel values using only CSS, avoiding JavaScript. This method leverages @property and trigonometric functions, providing unitless values that update in real-time upon screen resize.

  4. 4
    Article
    Avatar of csstipCSS Tip·2y

    Inverted border-radius using CSS mask

    Learn how to use a CSS mask to create an inverted radius corner with minimal code, without the need for extra elements or pseudo-elements, and optimized with CSS variables.

  5. 5
    Article
    Avatar of csstipCSS Tip·2y

    Animate to height/width auto (without hacks)

    Learn how to smoothly transition to `height: auto` using just three lines of code. The key is the `interpolate-size: allow-keywords` property. Compatible with the latest version of Chrome.

  6. 6
    Article
    Avatar of csstipCSS Tip·2y

    Update CSS variables using range slider

    Learn how to link a CSS variable with a range slider to update its value in real-time using scroll-driven animations, without the need for JavaScript. Includes a demo showcasing the technique, currently compatible with Chrome only.

  7. 7
    Article
    Avatar of csstipCSS Tip·2y

    Full-bleed layout with modern CSS

    Learn how to create a full-bleed layout using modern CSS. A full-bleed layout allows an element to extend beyond its container's boundaries, reaching the edge of the page. This tutorial provides various examples and compact syntax options for achieving this effect with CSS.

  8. 8
    Article
    Avatar of csstipCSS Tip·2y

    Typed CSS variables using @property

    Stop defining your CSS variables inside :root and start using @property to create typed CSS variables. This approach enhances debugging, provides implicit data validation, allows animations where applicable, and makes variables available globally with default values.

  9. 9
    Article
    Avatar of csstipCSS Tip·2y

    CSS-only background patterns with a minimal code

    Find a collection of CSS-only background patterns with minimal code. Easily adjust size and colors and navigate between patterns.

  10. 10
    Article
    Avatar of csstipCSS Tip·2y

    Fancy hover effect with anchor positioning

    Experiment with anchor positioning to create fancy hover effects such as sliding and jumping for menu items.

  11. 11
    Article
    Avatar of csstipCSS Tip·1y

    Glowing border animation with a smooth stop

    Learn how to add a glowing border animation around an element using modern CSS techniques like `@property`, CSS Mask, and Math functions. The animation is infinite on hover and stops smoothly when the mouse leaves the element.

  12. 12
    Article
    Avatar of csstipCSS Tip·2y

    Border gradient with border-radius

    Quick guide on adding gradient coloration to borders with rounded corners using CSS. Discusses current limitations and alternative methods like CSS mask and pseudo-elements.

  13. 13
    Article
    Avatar of csstipCSS Tip·2y

    Curved avatar header with hover effect

    Learn how to create a stylish curved avatar header featuring a hover effect using CSS masks, `@property`, and math functions. Benefit from optimized techniques with CSS variables and enjoy a clean, simple HTML implementation.

  14. 14
    Article
    Avatar of csstipCSS Tip·2y

    Grainy texture using CSS gradients

    Learn how to create a grainy texture background with CSS gradients using a few lines of code. This simple technique can add a unique, random-style background to your web projects.

  15. 15
    Article
    Avatar of csstipCSS Tip·2y

    Circular progress using scroll-driven animations

    Learn how to transform the native progress element into a circular one using only the <progress> tag, with control via 'max' and 'value' attributes. This Chrome-only experiment leverages scroll-driven animations and the @property feature in CSS.