` into a pop-up window
- `popovertarget="info"` button triggers the related popover.
#### Styling
Popovers are actually normal DOM elements, only the browser adds the logic of **opening/closing**. So you can style it as you wish:
[popover] {
padding: 1rem;
border-radius: 8px;
background: white;
box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
*In summary:* A brand new feature that allows the `popover attr()` HTML to produce opensable windows on its own.
Less JavaScript means more accessibility and easier care.
**👉** *HTML Demo* : [https://codepen.io/halimekarayay/pen/ByoXMwo](https://codepen.io/halimekarayay/pen/ByoXMwo)

##### *More Information*:
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/popover
---
### 5. Fetchpriority Attribute
Performance on web pages has always been one of the most critical issues. As of 2025, we can clearly state which resource should be loaded first thanks to the `fetchpriority attribute` supported by browsers. This seriously improves the user experience, especially for visuals and important files.
Scanners normally load resources according to their algorithms. But for example, if there is a large hero image at the top of the page, it is very important that it comes quickly. That's where `fetchpriority` comes into play.
`fetchpriority` can take three values:
- `high` → priority.
- `low` → then load it.
- `auto` → default.
Improves the LCP (Largest Contentful Paint) metric, the “visible” of the page is accelerated.
It provides a more fluent first experience to the user.
It makes a big difference, especially in multi -ly illustrated pages or heavy -based projects.

##### *More Information*:
- [https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/fetchPriority](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/fetchPriority)
---
## Modern CSS Techniques
### 1. CSS Nesting
CSS Nesting provides the ability to write a style rule into another style rule. In the past, this feature was possible only in prepromessors (eg Sass, Less), but now most of the browsers began to gain native support. With this feature, you can make style files more read, modular and easier to manage. In addition, the repetitive selector spelling is more comfortable to maintain the code.
Let's think of a simple **HTML** scenario:
Lorem Ipsum
Morbi maximus elit leo, in molestie mi dapibus vel.
Continue
If the common classic css is to be used, it is as follows:
.card {
padding: 1rem;
border: 1px solid #ccc;
}
.card h2 {
font-size: 1.5rem;
}
.card p {
font-size: 1rem;
}
.card a {
color: blue;
text-decoration: none;
}
.card a:hover {
text-decoration: underline;
}
You can write the same style as CSS nesting as follows:
.card {
padding: 1rem;
border: 1px solid #ccc;
h2 {
font-size: 1.5rem;
}
p {
font-size: 1rem;
}
a {
color: blue;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}
This structure increases readability by collecting style rules in a single block for the items in `.card`.
#### Recommendation
- You can use CSS Nesting directly in your project, but I suggest you pay attention to the following points:
- If the users of the target audience use old browsers (eg old Android browser, old iOS safari), think of Fallback Style or Polyfill.
- If the code is compiled (such as PostCSS), use the correct versions of Plugin who control nesting support.
- Deep Nesting can cause style complexity; Limit 2–3 levels for readability.
##### *More Information*:
- https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_nesting/Using_CSS_nesting
- https://www.w3.org/TR/css-nesting-1
---
### 2. @container Queries (Container Query)
We have used **media query** for **responsive design** for years: we have written different styles according to the screen width. But sometimes a component (eg a card) should behave differently in a different container. Here `@Container Queries` comes into play.
**Media query** looks at the width of the entire page. But sometimes it looks small when a card is lined up side by side, it should look big when it is alone. In this case, instead of looking at the page width, it would make more sense to look at the inclusive width of the card.
- The browser checks the condition in `@container` for each parent (parent) element.
- If the parent element is **marked as a container,** (`container-type` is given), its size is examined.
- So `@container` automatically connects to the nearest **“ container ”** upper element.
.card-list {
container-type: inline-size;
}
@container (min-width: 400px) {
.card {
flex-direction: row;
}
}
- `.card-list` → container.
- `.card` → child.
- When we say `@container (min-width: 400px),` the browser measures the width of the `.card` `.card-list`.
- If the `.card-list` width is greater than 400px, the style is working.
#### If there is more than one container
If there is more than one container in the same hierarchy, the browser is based on the closest.
// HTML
// CSS
.wrapper {
container-type: inline-size;
}
.card-list {
container-type: inline-size;
}
@container (min-width: 600px) {
.card {
background: lightblue;
}
}
#### container-name
If you want to say, **"which container should be looked at",** you should add the `container-name`:
.card-list {
container-type: inline-size;
container-name: cards;
}
@container cards (min-width: 600px) {
.card {
background: lightblue;
}
}
The browser is directly targeted by `.card-list`, and does not look at another container.
##### *More Information*:
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries
---
### 3. :has() Selector
CSS has always been able to give style for years. But it was not possible to “choose the parent according to his child”. Here `:has()` filled this gap and created the **parent selector revolution** in the world of CSS.
- It is possible to replace the upper element according to user interactions.
- We can only solve many conditions with JavaScript with CSS.
- Form validation, card structures, Dropdown menus are very practical.
For example, marking the form with incorrect input with red edges:
form:has(input:invalid) {
border: 2px solid red;
}
In the dropdown menu, emphasizing the menu, which has an element of hover:
.menu:has(li:hover) {
background: #f0f0f0;
}
In the card structure, giving different styles to the cards that contain pictures:
.card:has(img) {
border: 1px solid #ccc;
padding: 1rem;
}
- It allows you to write more **readable css**.
- Reduces the need for JavaScript in many places.
- It provides great convenience especially for **forms, navigation menus and card grids**.
##### *More Information*:
- http://developer.mozilla.org/en-US/docs/Web/CSS/:has
- https://www.w3.org/TR/selectors-4/#has-pseudo
---
### 4. Subgrid
CSS grid revolutionized the world of layout, but there was a missing:
The child grid elements in a grid could not directly use the line and column alignment of the parent grid. Here `subgrid` solves this problem.
- Provides consistent alignment.
- Nested saves grid from repetitive definitions in their structures.
- It produces cleaner, flexible and sustainable layouts.
Main grid:
.grid {
display: grid;
grid-template-columns: 200px 1fr;
grid-template-rows: auto auto;
gap: 1rem;
}
Child grid (subgrid):
.article {
display: grid;
grid-template-columns: subgrid;
grid-column: 1 / -1;
}
HTML example:
In this structure, `.article` forms its own grid, but it takes over its columns ** from parent grid **.
Thus, both the title, the article content and the foother appear to the same.
- Layout is more regular with **less CSS code**.
- Especially in **complex page designs** (blog, dashboard, magazine designs) great convenience
##### *More Information*:
- https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Subgrid
- https://web.dev/articles/css-subgrid
---
### 5. Scroll-driven Animations (scroll-timeline, view-timeline)
In the past, we had to use a **javascript** to move a item with scroll or to start animation.
But now thanks to the new feature of CSS, we can do this **directly with CSS**. This provides both performance and less coded solution.
- `@scroll-Timeline:` Allows us to use a scroll field as “timeline .. So the animation progresses as the page shifts down.
- `animation-Timeline:` It ensures that animation is synchronized with this scroll movement.
Let's make a box move to the right as a box shifts down:
// HTML
// CSS
.scroller {
height: 200vh;
background: linear-gradient(white, lightblue);
}
.box {
width: 100px;
height: 100px;
background: tomato;
animation: moveRight 1s linear;
animation-timeline: scroll();
}
@keyframes moveRight {
from { transform: translateX(0); }
to { transform: translateX(300px); }
}
📌 Here, `animation-timeline: scroll ();` when we say, the box is moving as scroll progresses. In other words, the percentage of progression of scroll is → animation progress.
#### Usage with view-timeline
In some cases, we may want the animation to **work while a particular item appears**.
That's where the `view-timeline` comes into play.
// HTML
// CSS
.container {
height: 150vh;
background: lightgray;
}
.card {
margin: 100px auto;
width: 200px;
height: 100px;
background: pink;
animation: fadeIn 1s linear;
animation-timeline: view();
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(50px); }
to { opacity: 1; transform: translateY(0); }
}
📌 Here `.card` when it begins to be visible, the animation comes into play.
**👉** *HTML Demo* : https://codepen.io/halimekarayay/pen/myVbmZy
##### *More Information*:
https://developer.chrome.com/docs/css-ui/scroll-driven-animations
-----
**In conclusion,** HTML and CSS are evolving every year, giving us the opportunity to do more with less code. The 10 techniques we covered in this article are among the must-know tools for modern web projects in 2025. Of course, technology keeps moving forward; but once you start adding these features to your projects, you’ll not only improve the user experience but also speed up your development process. Don’t be afraid to experiment—because the future of the web is being shaped by these new standards. 🚀