Lädt...


🔧 5 modern CSS features for 2024


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

Here are the five modern CSS features for 2024, along with example codes for each:

  1. :has() Selector:
    • This allows you to style a parent element based on its children.

Style the parent div if it contains a .active child

div:has(.active) {
       background-color: lightgreen;
   }```
{% endraw %}



2. Container Queries:
   - These enable responsive design based on the size of a container.

Change the layout of the card based on its container size
{% raw %}


```css
   @container (min-width: 500px) {
       .card {
           display: flex;
           flex-direction: row;
       }
   }

   @container (max-width: 499px) {
       .card {
           display: block;
       }
   }
  1. Nesting Selectors:
    • CSS now supports nesting rules for cleaner code.

Nested styles for a button within a card

   .card {
       background-color: white;
       padding: 20px;

       .button {
           background-color: blue;
           color: white;
           padding: 10px;
       }
   }
  1. text-wrap Property: This property helps distribute text evenly across lines.

Use text-wrap to balance text in a paragraph

   p {
       text-wrap: balance;
       width: 300px; / Set a width for the effect /
   }
  1. :focus-visible Pseudo-Class:
    • This improves accessibility by styling elements focused via keyboard navigation.

Highlight input fields when focused via keyboard


   input:focus-visible {
       outline: 2px solid blue;
       background-color: lightyellow;
   }

These examples illustrate how to implement each feature in your CSS, enhancing the responsiveness and accessibility of your web designs.

...

🔧 Introduction of CSS, What is CSS, Why we use CSS and How CSS describe the HTML elements


📈 29.26 Punkte
🔧 Programmierung

🔧 5 modern CSS features for 2024


📈 21.99 Punkte
🔧 Programmierung

🔧 5 modern CSS features for 2024


📈 21.99 Punkte
🔧 Programmierung

🔧 Choosing the Right CSS Approach: Tailwind CSS vs Bootstrap vs Vanilla CSS


📈 21.95 Punkte
🔧 Programmierung

🔧 A BRIEF REVIEW OF CSS CASCADING, CSS SELECTORS and CSS SPECIFICITY.


📈 21.95 Punkte
🔧 Programmierung

🔧 Stylify CSS: Automagic CSS bundles splitting into CSS layers in Astro.build


📈 21.95 Punkte
🔧 Programmierung

🔧 CSS Grid: Moving From CSS Frameworks To CSS Grid (2018 and beyond)


📈 21.95 Punkte
🔧 Programmierung

🔧 Yumma CSS - The new alternative to modern CSS Frameworks


📈 21.6 Punkte
🔧 Programmierung

🔧 Bulma CSS: A Modern CSS Framework for Responsive Design


📈 21.6 Punkte
🔧 Programmierung

🔧 Tailwind CSS and Bootstrap: A Comparison of Modern CSS Frameworks.


📈 21.6 Punkte
🔧 Programmierung

🔧 Post-Modern CSS (In-Depth on CSS Grid, Flexbox and Other New Properties)


📈 21.6 Punkte
🔧 Programmierung

🔧 Modern CSS for 2024: Nesting, Layers, and Container Queries


📈 16.71 Punkte
🔧 Programmierung

🔧 New CSS features (from august 2024)


📈 15.02 Punkte
🔧 Programmierung

🔧 Some new features CSS in 2024


📈 15.02 Punkte
🔧 Programmierung

🔧 3 CSS Features That I'm Hyped About in 2024


📈 15.02 Punkte
🔧 Programmierung

🔧 Mastering Modern Web APIs: Your Guide to Powerful Browser Features in 2024


📈 14.68 Punkte
🔧 Programmierung

🔧 10 modern Node.js runtime features to start using in 2024


📈 14.68 Punkte
🔧 Programmierung

🔧 JavaScript 2024: Latest Features, Performance, Modern Techniques, and Advanced Coding 🚀


📈 14.68 Punkte
🔧 Programmierung

🔧 Create Stunning Shadows With CSS Box Shadow | CSS Utility Generator Tutorial


📈 14.63 Punkte
🔧 Programmierung

🔧 How to create navigation menu with HTML CSS step by step | web design tutorial | HTML CSS tutorial


📈 14.63 Punkte
🔧 Programmierung

🔧 Exploring Astral.CSS: The CSS Framework Revolutionizing Web Design.


📈 14.63 Punkte
🔧 Programmierung

🔧 6 CSS Games to help you Learn CSS Easily


📈 14.63 Punkte
🔧 Programmierung

🔧 6 CSS tools for more efficient and flexible CSS handling


📈 14.63 Punkte
🔧 Programmierung

🔧 Elevate Your CSS with Typed CSS Variables Using `@property`


📈 14.63 Punkte
🔧 Programmierung

🔧 Stylify CSS: Code your Remix website faster with CSS-like utilities


📈 14.63 Punkte
🔧 Programmierung

🔧 CSS BEM Model – A Guide to Writing Scalable and Maintainable CSS


📈 14.63 Punkte
🔧 Programmierung

🔧 Tailwind CSS vs. CSS Frameworks: A Comprehensive Comparison for UI Design


📈 14.63 Punkte
🔧 Programmierung

🔧 🤔 Can You Improve CSS? Help invent CSS Masonry layout...


📈 14.63 Punkte
🔧 Programmierung

🔧 How Tailwind CSS is Dominating the CSS Framework Landscape


📈 14.63 Punkte
🔧 Programmierung

🔧 CSS Guide: Basics of CSS


📈 14.63 Punkte
🔧 Programmierung

🔧 A New Quiz: CSS Selectors, Ways to Add CSS, Comments


📈 14.63 Punkte
🔧 Programmierung

🔧 Transform Your CSS Game: Bookmark These 10 CSS Generators


📈 14.63 Punkte
🔧 Programmierung

🔧 css-shape.com: The Ultimate Collection of CSS-only Shapes ⚡️


📈 14.63 Punkte
🔧 Programmierung

🔧 Mojo CSS vs. Tailwind: Choosing the best CSS framework


📈 14.63 Punkte
🔧 Programmierung

matomo