r/css • • Dec 21 '25

Question How can I make this metallic effect?

1.5k Upvotes

r/css • • Nov 18 '21

Cursed CSS: Only odd numbers

Post image
895 Upvotes

r/css • • Apr 16 '19

Flexbox - Visual Cheat Sheet

Post image
865 Upvotes

r/css • • Sep 22 '25

General Built without AI, pure HTML and CSS

Post image
861 Upvotes

I built this apple iphone 17 pro design mockup using html and css. No vibe coding, fancy ai code editors. Just like how we used to build something before AI. Handcrafted pixel by pixel until it looked perfect. How's this ?


r/css • • Jul 30 '20

SVG

Post image
852 Upvotes

r/css • • Apr 28 '23

Graphic Designer vs CSS Developer

829 Upvotes

r/css • • Nov 18 '24

General Center a div with CSS on 2024!😄

Post image
672 Upvotes

r/css • • Nov 10 '21

Learning CSS making memes is the best way to learn CSS (code in comments)

Post image
645 Upvotes

r/css • • Oct 13 '21

CSS Flex Explained in 1 Animation

621 Upvotes

r/css • • Sep 15 '20

Sometimes it's just fun to make something dumb

602 Upvotes

r/css • • Mar 02 '21

I hope this isn't gonna backfire at some point

Post image
591 Upvotes

r/css • • Mar 27 '22

I created a Minecraft bee with CSS

590 Upvotes

r/css • • Aug 17 '25

General Stop using px for everything. Here’s why rem and em will save you headaches.

585 Upvotes

A lot of devs default to px, but that breaks accessibility and responsiveness. Quick breakdown:

px: fixed, ignores user zoom preferences.

em: relative to parent element's font-size. Great for padding/margins inside components.

rem: relative to root (html) font-size. Perfect for consistent typography across the app.

Rule of thumb :

Use rem for type and spacing across the layout.

Use em for component-level scaling (buttons, inputs).

Use px only when you truly need fixed precision (e.g., border-width).


r/css • • Jul 22 '25

General Just learned this the hard way don’t name your classes or IDs anything like “ad”

574 Upvotes

Was working on a project recently where everything looked perfect on my end, Chrome, Firefox, mobile… no issues.

But then the client told me a section was just not showing up for them in Firefox. Took me way too long to figure it out.

Turns out, I had used a class name like .ad_div, and ad blockers were silently nuking the entire element.

So yeah, even if you're not actually building ads, avoid naming anything ad, ads, ad-banner, etc., unless you want to spend an hour pulling your hair out.

Curious, has anyone else run into little traps like this that you only learn the hard way?


r/css • • Dec 11 '24

General A button that doesn't change width when showing a spinner: Use CSS Grid to stack items, and visibility: hidden to hide/show spinner

552 Upvotes

r/css • • Jan 19 '22

Liquid Animations 🌊🌊 using Pure HTML and CSS

549 Upvotes

r/css • • Feb 09 '26

General my flexbox implementation of the CSS center truncate demo

545 Upvotes

u/medotgg posted this demo an hour ago but without any code. Here is my take on doing it with flexbox.


r/css • • Nov 29 '19

Not sure if this media query is going to work on this particular page

Post image
530 Upvotes

r/css • • Mar 07 '21

When my css is missing "that little something"

Post image
498 Upvotes

r/css • • May 02 '21

I made a website that helps people learn CSS Grid interactively & easily

493 Upvotes

r/css • • Sep 05 '25

Other tailwind is ass

490 Upvotes

Tailwind is absolutely awful.

I used bootstrap back in the day and I did eventually come around to realising how awful that was too.

Littering your HTML with crap like this:

<div class="mx-auto flex max-w-sm items-center gap-x-4 rounded-xl bg-white p-6 shadow-lg outline outline-black/5 dark:bg-slate-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10">

It's MASSIVELY inefficient - it's just lazy-ass utility first crud.

It may be super easy for people who cannot be bothered to learn CSS - so the lazy-ass bit - but for anyone who KNOWS css, it's fucking awful.

You have to learn an abstract construct cooked up by people who thought they knew what they were doing - who used bootstrap as a reference point.

Once upon a time, CSS developers who KNEW CSS figured that the bootstrap route was the bees-knees, the pinnacle of amazingness.

Then that house of cards fell on its ass - ridiculously hard to maintain, stupidly repetitive - throws the entire DRY methodology out the window. Horribly verbose. Actually incredibly restrictive.

This is from someone who drank the coolaid - heck, who was around BEFORE bootstrap, when this kind of flawed concept reared it's ugly head.

What you want is scoped css that is uglified, minified and tree shaken at build time - and what you want is a design system.

Something like this, in uncompiled code:

<Component atoms="{{ display: "flex", gap: "<variable>", backgroundColor: "<variable>"}} className={styles.WeCanHaveCustomCssToo}>...</Component>

When compiled down and treeshaken and uglified, it may end up being:

<div class="_16jmeqb13g _16jmeqb1bo _16klxqr15p"> ... </div>

It's scoped, on each build it's cache busted, it's hugely efficient and it's a pleasure to work with.

Most importantly, there's patten recognition in the compile process, where anything with the same atoms ends up with the same compiled classname, ditto for custom classes that could fall outside of a design system.

I'm not going to claim this concept is simple, it isn't, but it's for developers who understand CSS, who understand why CSS is important and who realise just how bloody awful tailwind is.

tailwind is ass.


r/css • • Jul 12 '26

General I finally removed Tailwind from a production project and just used modern native CSS

487 Upvotes

Our team has defaulted to using Tailwind CSS for almost every web project over the last few years. It was great for moving fast early on, but on our latest project, the utility class bloat was getting completely out of hand. The HTML files looked unreadable, and managing long strings of responsive layout classes across reusable components was becoming a maintenance headache.

I decided to spin up a branch and rewrite a major dashboard interface using entirely vanilla native CSS. I hadn't built a pure CSS layout in a while, and I was genuinely shocked at how powerful native CSS has become over the last couple of years.

Features that used to require massive utility frameworks or preprocessors are now fully built-in. I heavily utilized native CSS nesting, CSS variables for theme management, and the newer container queries to handle complex responsive components based on their parent size rather than the entire viewport.

The results were surprisingly great. Removing the Tailwind processing step simplified our build pipeline, our final bundle size dropped, and the code felt vastly cleaner. Writing native styles inside modern semantic stylesheets made debugging layout bugs in the browser developer tools a hundred times easier because I wasn't digging through a wall of utility classes.

Tailwind is still an incredible tool for prototyping, but I realized I was using it out of habit rather than necessity. Modern native CSS has quietly caught up to the point where you can build incredibly complex, maintainable layout systems without adding a utility abstraction layer on top of it. If you haven't looked at native CSS features lately, it might be worth trying on a small feature branch.


r/css • • Nov 28 '19

TIL you can animate a range slider's thumb with CSS variables so I had to make this rolling little friend

483 Upvotes

r/css • • Jun 10 '20

Me spacing content summed up

Post image
482 Upvotes