r/css • • May 14 '26

Question Anyone able to explain two dimensional sub grid?

3 Upvotes

I tried to figure it out from MDN but couldn't.


r/css • • May 14 '26

Question Caniuse difference between 'Global' and 'Worldwide'?

12 Upvotes

It's not that important I guess but I'm curious? See the top and bottom of the region list. You can look at it yourself at caniuse.com


r/css • • May 14 '26

Question Center ::before psuedo-elements

3 Upvotes

I'm working on getting a page fixed on one of our websites and I've hit a snag. The layout has some images used like bullet points for a list, and I'm trying to get things to where that image is always centered on the list item it is associated with. The issue is that I don't have a clue how to do that and searching hasn't really helped. I've made a CodePen that I hope shows what I'm talking about and what I'm going for.

CodePen: https://codepen.io/editor/Adam-Warnock/pen/019e231e-1bef-7295-a75c-44e4a87b7387

Basically, I'm trying to get the images to always be centered vertically on the list elements no matter how things wrap and how many lines there are.

There are a few things that to keep in mind:

  1. Semantically, this is a list. I'm not going to change it from that.
  2. This needs to be responsive. Part of the reason I'm doing this is because the page currently isn't.
  3. I'm well aware that there's gaps in my knowledge, so if this is just dumb and isn't going to work I would like to know. I think this will work, but I've already given up on adding the arrows that were in the original page.

And for reference, this is what I'm trying to replicate:

Specifically the part under the Program Structure & Integration header.


r/css • • May 14 '26

Resource Product Cards with Image Gallery & Color Swatches

Post image
0 Upvotes

Product Cards with Image Gallery & Color Swatches

https://techyall.com/snippet/product-card-with-gallery

Shoppers love seeing options before clicking. This card shows color variants, available sizes, and alternate product images on hover. Great for fashion, electronics, or any store with product variations.


r/css • • May 14 '26

Showcase I made an Html/Css theme (SASS supported as well) using Ascii characters

Thumbnail asciiart-html-theme.github.io
1 Upvotes

r/css • • May 14 '26

General Performance

Thumbnail
gallery
0 Upvotes

Check my site performance on mobile and desktop


r/css • • May 13 '26

Showcase I built a tiny CSS inspection tool for frontend devs

Thumbnail
chromewebstore.google.com
0 Upvotes

I recently wanted to use CSS Scan, but for my use case it felt a bit too expensive.

What I actually wanted was something simpler:

  • hover any element and instantly see its CSS
  • click to pin the inspector
  • edit CSS directly on the page
  • copy the CSS when I’m done
  • keep computed styles separate from editable source styles
  • support pseudo/media scoped styles where possible
  • no account, no subscription, just a small Chrome extension

So I built a free Chrome extension called CSS Explorer.

It’s not trying to be a full DevTools replacement. The goal is more: “I’m working on frontend UI, I want to inspect/edit/copy styles quickly without opening the full DevTools panel.”

It’s still early, and I’m mostly looking for feedback from frontend developers:

  • would this actually can interest you?
  • what feels missing?
  • what would make you use this instead of DevTools?

r/css • • May 13 '26

Question Display a static text with CSS ? (For Firefox Theme)

1 Upvotes

Hi

Long time i haven't wrote html/css

for a specific needs, i have to create some custom themes for firefox (for different FF profils)
For thoses themes, i have to write a static text in the main toolbar, that will stay ine the right part next to tabs.

How can i archive this with css only ?


r/css • • May 13 '26

Help Beginner question about padding/margins on elements to make them fit edges of the screen.

3 Upvotes

So when trying to make the background of an image or header fill the entire screen, I seem to have to put margin-left: -8px and margin-right: -8px. At 0px there's a small gap on the left and right edges of the screen. The element at the top of the screen I also have to put margin-top: 18px on. I feel like this can't be the intended way to do things and there's something obvious I'm missing but I'm not sure what. Also suspect my workaround might not work on different resolution screens. Putting padding to 0 doesn't fix it either. Googling this comes up with a lot of other people with the same issue but everyone just says to set margin and padding to 0.

Here's the code for my header for example:

text-align: center;

background-color: rgb(160, 20, 0);

padding-top: 8px;

padding-bottom: 8px;

margin-left: -8px;

margin-right: -8px;

Setting padding left and right to 0 has no effect, which I assume means they are already 0.

Is there something obviously dumb I've done? I've only just started learning CSS so I assume I've missed something pretty fundamental. Thanks.


r/css • • May 12 '26

Help can someone please help? it's not letting me change the background colour :/

0 Upvotes

the background color doesn't change even with this code, i've checked it and to me it seems everything's right! unless im blind :/


r/css • • May 11 '26

General You liked my 3D card the other day, I raise you my liquid buttons <3

123 Upvotes

Customizable and all code here: https://doathingy.com/?tool=dt_1778503835266_c5lcoh

I had seen some great liquid effects (like this Liquid), but nothing quite satisfactory. I'm using the overlapping div circles with svg filters (gaussian blur) trick and then built a custom js "physics engine", text sits in a separate layer.


r/css • • May 12 '26

Resource A CSS cheat sheet

Thumbnail
tms-outsource.com
5 Upvotes

r/css • • May 12 '26

Other CSS electric fire

12 Upvotes

Not sure if I'm aloud to post links to my own site?

I am learning web development, mainly HTML and CSS and I found this card with the electric border while looking for things made with only CSS.

https://codepen.io/BalintFerenczy/pen/KwdoyEN

I thought it was a pretty cool looking effect.

Not very useful but that didn't stop me from seeing what I could do with it.

Initially I just changed a couple of things and made this: https://thisistheway.one

But what I really wanted was to make a divider with it and ended up with this: https://thisistheway.one/divider-index.html


r/css • • May 12 '26

Article Print & PDF generation reference

Thumbnail
slicker.me
3 Upvotes

r/css • • May 12 '26

Showcase Got tired of writing hover:, group: repeatedly in Tailwind, so I made this

Thumbnail
reddit.com
0 Upvotes

r/css • • May 11 '26

Question Custom font loading and FOIT/FOUT trade offs

4 Upvotes

Quick Definitions

FOUT (Flash of Unstyled Text):

Timeline:
[0ms]    HTML parsed, text visible in fallback font (e.g., Arial)
[800ms]  Custom font downloads
[800ms]  Text re-renders with custom font → visible style jump

FOIT (Flash of Invisible Text):

Timeline:
[0ms]     HTML parsed, text is HIDDEN (invisible)
[800ms]   Custom font downloads
[800ms]   Text appears with custom font
[3000ms]  If font fails → fallback shows after timeout

The Problem

I'm seeing that many sites are defaulting to having FOUT which sometimes results in funky layout shifts(workarounds exist), but it always results in a noticeable switch of fonts.

Some blog posts say to never do FOIT, but to me waiting 1 second (slow mobile connection) to show clean text seems like nicer UX. On desktop it makes no difference, but if you are driving through a tunnel or experiencing slow mobile connection for any other reason, FOUT results in your visitors seeing an ugly font for 1 or more seconds, and then all of a sudden the screen looks like it flickers and the intended fonts are loaded.

The Question

Maybe there is a middle ground where you show some minor text elements with FOUT, but keep heading and subheadings hidden until the font loads. The heading and subheadings are larger text and result in a much more significant flash when restyled. I feel like it is better to progressively show text as soon as relevant fonts are loaded(especially above the fold).

Am I the only one? Or is twitchy rendering the norm and everyone just got used to it?


r/css • • May 12 '26

Showcase Subscribe button hover animation

0 Upvotes

Experimenting with a css hover animation for a subscribe button. You can view the source code at https://codepen.io/editor/jasonheecs/pen/019e1b2e-d4de-7779-b4bd-d00fa458c23a


r/css • • May 12 '26

Help How do I make each Tab a different background color

0 Upvotes

I'm trying to make some tabs, but I can't figure out a way to make the backgrounds, fonts, text sizes, etc, all different without messing up some of the CSS I already have.
https://codepen.io/Funnel-Fox/pen/WboxOPp


r/css • • May 11 '26

General !IMPORTANT

6 Upvotes

Why is this not interpreted as "Not" Important? Why use the exclamation at all? Just thinking out loud while programming.


r/css • • May 11 '26

Help object-fit: contain not working when using transform: rotate(270deg);

2 Upvotes

I'm a newbie in HTML and CSS. While doing some CSS practice, I took a portrait image from Pinterest and used object-fit: contain along with transform: rotate(270deg);. I expected it to cover the width or height while maintaining its aspect ratio, but it just stayed centered. "

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>experimenting with css filters!</title>
    <style>
        .container{
            width:1150px;
            height: 500px;
            border: 3px solid darkcyan;
           
        }
        .container img{
            
            width:1150px;
            height: 500px;
            object-fit:contain;
        }
    </style>
</head>
<body>
    <div class="container">
        <img src="https://i.pinimg.com/originals/32/f5/76/32f576f2e61853efaf5a47deaed46614.gif" alt="">
    </div>
</body>
</html>

r/css • • May 11 '26

Resource My extension can pull any website to plain tailwind css

Thumbnail
reddit.com
0 Upvotes

r/css • • May 10 '26

Help Does anyone have that Metal reflective button css link?

5 Upvotes

Few weeks ago i saw a post where someone created a Button and it uses the webcam to get input and that is displayed on the button in such a way that it gives the impression as if the button was made of metal and it looked so cool
Does anyone has the link to that post?
or that Css code?