This One Thing Causes Most CSS Issues! (learn how to avoid it)
In this video, I discuss a common issue where engineers unintentionally "do too much," leading to problems in CSS. We review several examples, starting with a common method to center content using CSS shorthand. This technique often sets vertical margins to zero, which can cause problems if other rules need to apply vertical margins to that element. Next, we examine the "background" shorthand property, which might accidentally remove properties like "background-image." We also cover the issue of creating overly broad rules that apply styles to unintended elements—another case of "doing too much." We explore solutions for these issues, such as using longhand properties, more precise targeting with CSS selectors, or using backend logic to assign specific utility classes. This ensures that styles are applied correctly without unintended effects. The main point is to be more deliberate with the styles you write. Avoid complicating CSS with shorthand and broad declarations that could impact more elements than intended. Watch the video to learn more! CodePen from the video: https://codepen.io/dmtrmrv/pen/dyLxPBw Chapters: 00:00 – Introduction 00:12 – Example #1: Centering Content Horizontally 00:48 – Why This Shorthand Is Problematic 02:13 – Better Alternatives 02:30 – Not All Shorthands Are Harmful 02:50 – Example #2: The Background Issue 03:06 – Potential Problems with This Shorthand 04:13 – Recommended Alternatives 04:22 – Example #3: Beyond Shorthands 04:46 – Exploring Potential Downsides 05:22 – Alternative Solution #1 06:29 – Alternative Solution #2: Still "Too Much" 06:47 – Alternative Solution #3: A More Effective Approach 08:04 – Alternative Solution #4: Using a Utility Class 08:42 – Conclusion Get updates about new videos in your inbox → https://tinyurl.com/yuu8x8my Follow me on Twitter: / dmtrmrv

Master CSS Units: Pixels, REMs, & EMs

Make Sense of Box-Sizing in CSS (and avoid this major mistake!)

🧠 Quiz Application Using HTML, CSS & JavaScript | Interactive Quiz App | Complete Frontend Project

Why I Use MacWhisper Daily (Are You Missing Half Its Features?)

Master CSS Spacing: Margin, Padding, and Gap Explained

Casey Muratori – The Big OOPs: Anatomy of a Thirty-five-year Mistake – BSC 2025

Adobe Is Completely F*cked.

Don't Use @layer in CSS! (until you know these two things)

Naming Things in Code

CSS Tip: Extend a Child Beyond Parent Width (the better way)

Has an AI discovered new maths?

10 NEW CSS Features You Need To Know For 2026

Mr.Bean Making Celebrities Cry With Laughter NONSTOP!

Pink Hue Wallpaper Screen

A new approach to container and wrapper classes

The CSS Variables Trick You’ll Wish You Knew Sooner

No Boss, No Money: The Raw Reality of China’s Gen-Z Freelancers

System Design Course – APIs, Databases, Caching, CDNs, Load Balancing & Production Infra

Passkeys Explained: Are They Actually Better Than Passwords?

