Cơ chế quyết định style nào được áp dụng khi có xung đột.
- Thứ tự ưu tiên đầy đủ (từ thấp đến cao): @layer order < specificity < source order < origin (browser default < user styles < author styles) < !important < inline styles.
- CSS 2021 thêm
@layerđể quản lý nhóm styles — styles trong layer sau override layer trước bất kể specificity, và styles ngoài @layer có ưu tiên cao hơn mọi layer. - Cascade giúp quản lý styles phức tạp.
The mechanism that determines which style is applied when there are conflicts.
- Full priority order (lowest to highest): @layer order < specificity < source order < origin (browser defaults < user styles < author styles) < !important < inline styles.
- CSS 2021 added
@layerfor grouping styles — later layers override earlier ones regardless of specificity, and unlayered styles beat any @layer. - Cascade helps manage complex styling scenarios.