Skip to main content

The 10 Best New CSS Features in 2025 Already Supported in All Major Browsers

 



CSS keeps evolving with new capabilities that make our work faster, cleaner, and more powerful. Thanks to the latest browser advances (Baseline 2024), many fresh features now work across all major engines. Below are ten highlights you can start using right away.

Do you want more? Let’s check out my project, CSSToday: csstoday.dev/

1. Scrollbar-Gutter & Scrollbar-Color

When a browser displays a scrollbar, the layout can shift as space is taken up. With scrollbar-gutter, you can preserve scrollbar space even before scrolling begins:

.scrollable {

 scrollbar-gutter: stable both-edges;

}

You can also style your scrollbars with scrollbar-color:

.scrollable {

 scrollbar-color: #444 #ccc;

}

This ensures a consistent look and prevents layout jumps.

What it’s good for ✅

  • scrollbar-gutter keeps layouts stable by reserving space for a scrollbar, preventing annoying shifts when the scrollbar appears.

  • scrollbar-color lets you style the scrollbar’s track and thumb, enhancing design consistency, especially for dark or themed UIs.

2. ::target-text

::target-text highlights text that’s reached by an internal link (for example, when clicking an anchor on the same page):

::target-text {

 background: yellow;

 color: black;

}

Readers immediately see the exact part of the text they’ve navigated to.

What it’s good for ✅

  • Highlights the exact text targeted by a link anchor, making it immediately clear where users have landed in long documents or articles.

3. Ruby Layout (ruby-align & ruby-position)

For certain languages and annotations, ruby-align and ruby-position are essential. They let you control how short annotations (ruby text) are placed relative to the main text:

ruby {

 ruby-align: center;

 ruby-position: over;

}

What it’s good for ✅

  • Essential for East Asian typography, allowing precise control of small annotations (ruby text) above or beside main text.

  • Also useful for inline annotations in educational or reference materials.

4. Relative Color Syntax & light-dark()

Modern color handling in CSS includes relative color syntax, which lets you adjust properties like lightness or saturation from an existing color. Additionally, light-dark() allows you to switch easily between light and dark color values:

.element {

 background: light-dark(#ffffff, #000000);

}

You can also use <color-interpolation-method> to create smoother gradients in different color spaces.

What it’s good for ✅

  • The relative color syntax enables dynamic adjustments like saturation or lightness based on a reference color.

  • light-dark() simplifies toggling between light and dark color values, a common need for themes or dark mode.

5. Exclusive Accordions

Accordions typically require JavaScript to ensure only one panel is open at a time, but HTML’s <details> helps simplify this. Here’s a short snippet to keep panels mutually exclusive (https://developer.mozilla.org/en-US/docs/Web/API/HTMLDetailsElement/name):

<details name="exclusive">

 <summary>Details</summary>

 Something small enough to escape casual notice.

</details>

details {

 border: 1px solid #aaa;

 border-radius: 4px;

 padding: 0.5em 0.5em 0;

}


summary {

 font-weight: bold;

 margin: -0.5em -0.5em 0;

 padding: 0.5em;

}


details[open] {

 padding: 0.5em;

}


details[open] summary {

 border-bottom: 1px solid #aaa;

 margin-bottom: 0.5em;

}

What it’s good for ✅

  • Allows you to show one panel at a time without complex JavaScript logic.

  • Ideal for FAQs, menus, or any scenario where only one detail should be open.

6. content-visibility

content-visibility skips rendering of off-screen elements until they scroll into view:

.lazy-load-section {

 content-visibility: auto;

}

This reduces the initial rendering cost, improving performance on long pages.

What it’s good for ✅

  • Defers rendering of off-screen elements, boosting performance for long pages or complex layouts.

  • Improves speed and reduces memory usage, especially on mobile devices.

7. font-size-adjust

When a custom font isn’t available, browsers fall back to another font, often disrupting the layout. font-size-adjusthelps keep text size and readability consistent:

.text {

 font-family: "CustomFont", Arial, sans-serif;

 font-size-adjust: 0.5;

}

This maintains similar x-heights and legibility across font fallbacks.

What it’s good for ✅

  • Maintains consistent text appearance when custom fonts are unavailable or loading is slow.

  • Helps preserve readability and design by matching the x-height of fallback fonts.

8. transition-behavior

While transition-timing-function has served us well, transition-behavior introduces additional control over animations, such as reversing or pausing transitions without complex JavaScript. This paves the way for smoother UI interactions and advanced animation scenarios.

.card {

 transition-property: opacity, display;

 transition-duration: 0.25s;

 transition-behavior: allow-discrete;

}


.card.fade-out {

 opacity: 0;

 display: none;

}

What it’s good for ✅

  • Expands on basic transitions to offer reversible or more complex transitions without heavy scripting.

  • Useful for refined UI effects, interactive components, and unique animation scenarios.

9. CSS @property & Stepped Value Functions

@property makes it possible to declare custom properties with predefined syntax, inheritance rules, and initial values:

@property --animation-progress {

 syntax: "<number>";

 inherits: false;

 initial-value: 0;

}

You also get new stepped value functions like round(), mod(), and rem() for calculations directly in CSS, eliminating many JavaScript or preprocessor hacks.

What it’s good for ✅

  • @property turns custom properties into fully declared variables with types, defaults, and inheritance rules.

  • Functions like round(), mod(), and rem() enable straightforward math in CSS, reducing reliance on preprocessors or JavaScript.

10. offset-position & offset-path

For more complex motion design, offset-position and offset-path let you animate elements along a custom path without heavy JavaScript frameworks:

.move {

 offset-path: path("M10,80 Q95,10 180,80");

 offset-position: 0%;

 transition: offset-position 2s ease;

}

With these properties, you can create polished animations guided by SVG paths or simple curves.

What it’s good for ✅

  • Allows path-based motion and animation purely in CSS.

  • Great for interactive elements, motion graphics, or guiding user attention along curved trajectories.

Conclusion

Each of these features is already supported in all major browsers. They remove the need for many JavaScript workarounds and let you build layouts and interactions that are simpler, faster, and more maintainable. Try them out and see how they can elevate your projects to a new level of efficiency and elegance. Have fun experimenting!

Do you want more? Let’s check out my project, 


Comments

Popular posts from this blog

Sharpen Your Front-End Skills: Quick HTML, CSS & React Interview Challenges

  The source of this image is Chat GPT based on writing! Are you preparing for front-end developer interviews and looking for practical, hands-on ways to improve your HTML, CSS, and React skills? Whether you’re a beginner aiming to build confidence or an experienced developer brushing up on UI skills, small, targeted challenges can make a huge difference. In this article, I’ll walk you through some of the best free and low-cost resources that offer real-world front-end tasks — perfect for interview prep, portfolio building, and daily practice. 1. Frontend Mentor frontendmentor.io Frontend Mentor is one of the most popular platforms for hands-on HTML, CSS, and JavaScript challenges. You get beautifully designed templates (in Figma or image formats) and are asked to bring them to life using clean code. The platform offers difficulty levels ranging from newbie to expert, and it’s perfect for practicing responsiveness and semantic HTML. Bonus : You can even filter for React-based ...

React Native vs React JS — Key Difference, Advantages-Disadvantages, Limitations

  React Native vs React JS — Key Difference, Advantages-Disadvantages, Limitations React JS It is a JavaScript library that supports each face and server-side. It’s a popularly used library that focuses on developing user interfaces for mobile and internet-primarily based applications. React Native It is a cross-platform mobile framework that uses the ReactJS framework. It’s primarily used for developing native mobile applications like Windows, iOS and mechanical man. The major advantage provided by React Native is that it permits the developers to form mobile applications on varied platforms while not compromising the tip user’s expertise. Components of React JS Components of React Native Basic parts View — it is the essential building block of internet applications. Text — It helps to point out the text. The text element contains nesting, styling, and bit handling. Image — this is often a React element for showing multiple footages like network pictures and static resources. Text...

Difference Between Three.js and Babylon.js: What Actually Should You Choose?

You don’t have to be just a graphic designer to create interactive designs. You can be a coder and still create visually appealing and eye-catching games. All thanks to JavaScript. The first cross-browser JavaScript library–three.js–that can create 3D computer graphics was first released on 24 April 2010 by Ricardo Cabello. He first wrote the code in ActionScript language, which was then used by Adobe Flash. But then in 2009, he ported the code to JavaScript. Previously, people used WebGL. But the problem was its limitation: it can create only simple pointers and lines. Ricardo, instead of abandoning WebGL as something that is futile, used it to his own advantage. He built three.js on top of WebGL. This renders three.js to create 3D graphics in the browser. Even a 3D scene can be created easily using Canvas and WebGL now. But then in 2013, Babylon.js was created. But why? Why did its creators, Microsoft and David Catuhe, make something that another JavaScript library–three.js –was alre...