r/css • • 1h ago

AI Assisted Week 1 of learning in public as a CS student: Building my first page with HTML & CSS (and finally understanding Flexbox)

1 Upvotes

Hey everyone! I'm a Computer Science student starting a "learn in public" habit to document my progress outside of regular classwork.

This week I focused on HTML and CSS fundamentals—structuring semantic tags properly and building a simple responsive layout from scratch. The biggest "aha!" moment for me was finally getting CSS Flexbox (justify-content vs. align-items) to click after spending way too long trying to center a simple card element.

Next week I'm planning to build a clean personal portfolio page to practice CSS Grid and responsive media queries.

For those who have been doing web dev for a while: what is one CSS trick or habit you wish you had learned during your very first week?


r/css • • 5h ago

AI Assisted A customizer for my CSS library: pick what you need, get one file

Post image
3 Upvotes

I've built sites with my own CSS library, Minium, for around three years. I wanted to make it easier to customize, and to let you pick what you need. It is a minimalistic CSS library after all. So I built a customizer. You pick the parts you want, and preview the result in light and dark mode before you download one CSS file. The core is ~10KB gzipped, and everything is ~15KB.

There is no build server, because the library stores design decisions in custom properties:

  • Each design token is declared once in theme.css. The customizer just replaces values by name. Radius, border width, line height, flow spacing and so on.
  • There are seven color roles (neutral, primary, accent, success, danger, warning, info). Each role maps to a Radix color scale. You can select one of 31 color themes or build your own.
  • Each component lives in its own file and cascade layer, so the customizer can leave files out.

The page fetches the source CSS from the repo, applies your choices and minifies it in the browser. Extra fonts come from Fontsource on jsDelivr. And the URL holds your choices, so you can share the build as a link.

Some limitations: The library is pre-1.0 and targets current browsers, since it uses features like anchor positioning, CSS nesting and light-dark().

I wrote the CSS by hand. I used Claude to write the customizer's JavaScript.

What would you want to customize that isn't there?


r/css • • 6h ago

AI Assisted Frag: A tool to steal alphanumeric/hex tokens using image backgrounds

Thumbnail
github.com
2 Upvotes

Frag is a tool for extracting secret tokens from web pages using only CSS - no JavaScript required. It generates CSS payloads that use attribute selectors and background-image URLs to exfiltrate overlapping token fragments to an attacker-controlled server, then reconstructs the full token using De Bruijn graph traversal and Eulerian path algorithms.


r/css • • 7h ago

Article my css tool website css-tool.com is live now!

2 Upvotes

Hey guys, my css tool website https://www.css-tool.com is live now!

Your suggestions are highly appreciated.

It would be my honor!


r/css • • 17h ago

Question How to properly scale images vertically in a container and preserve their right aspect ratio?

7 Upvotes

I want to write some custom CSS for a page I'm using, it has a custom CSS in its options so its really easy, but that means I can't do anything to HTML side of things, only CSS.

What I want to do is to make their media gallery wider and turn it into a carousel. Making the gallery wider also means I want to make the images there have increased height, as there is more real estate for them to fit it. The problem is that images and videos there are user submited and don't have a standardized aspect ratios or anything, everone can upload whatever they want. This is troubling me a bit as I don't know how to make it responsive, originally everything had set width and height in pixels, but I want to make it responsive, but no matter what I do, those images don't look right, sometimes they are clipped, sometimes they are massive and I was tweaking and tweaking it to the point I decided to ask for some help as nothing I do seems to work and no solution on internet helps me either, maybe I can't google who knows.

The HTML side of things basically looks like this: (The amount of content there is in card-media can very, from just 1 element to I think 50)

<div class="card">
...
  <div class="card-media">
    <img class="card-media-element" width="450" height="450">
    <img class="card-media-element" width="450" height="253">
    <img class="card-media-element" width="364" height="400">
  </div>
</div>

There is some already existing CSS, but it shouldn't really affect what I want, the only relevant thing that could be affecting it somehow is that card-media has position relative set and card-media-element has block-size set to auto (first time seeing this property personally, so I'm unsure what it does), but I tried to change or remove these, and nothing happened to the sizes of images. Other than that there is just text color, size, font and only stuff like that.
The CSS I wrote currently looks like this:

.card-media {
  display: flex;
  gap: 0.25rem;
  max-width: 100%;
  overflow-x: scroll;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
  width: 100%;
  height: 100%;
  max-height: 26em;
  padding: 0.25em;
}

.card-media-element {
  object-fit: cover;
  height: auto;
  width: auto;
  max-height: 50vh;
}

The problem with this is that the images I am looking at are like zoomed in so I can't see them whole as they are like cropped, if I remove the object-fit then they are stretched, like square images become rectangular for some reason. What I want is to make all of them have the same height, and their width would be adjusted to the individual image aspect ratio. Basically I want to have consistent height of media in the card-media div, and their width can be however long it has to be, as it's overflowing anyway.

Is this possible?


r/css • • 1d ago

Question Wow, I really want to learn CSS really well! It's something I've always struggled with, so it's tough to feel confident when I try something new. Do you have any tips on where I should focus my studies first?

6 Upvotes

r/css • • 1d ago

No AI used Introducing spatial CSS: A developer preview

Thumbnail
webkit.org
1 Upvotes

r/css • • 1d ago

Help Fixing a site skin that uses a different font for cursive words?

Post image
3 Upvotes

Basically, the CSS is from here: https://github.com/ao3skinsss/even-more-skins/wiki/Sakura

When I open it on my AO3 page, cursive words seem to be in Helvetica while the rest is in the standard font. How do I fix this?


r/css • • 2d ago

Help Help Me Find This Coding Tutorial

2 Upvotes

Soo a few years ago (prob 1) i saw a tutorial idk if it used css or js but it used it to make custom mouse cursors

Ik there are many tutorials that show the same but this one was special it had 4 cursors and all were having a feature which increased their size on clicking

To activate other cursor we just had to put our mouse on the box of that cursor

The transition between cursors was very smooth

3 of them were anime based and 1 was just a point with circle around it


r/css • • 2d ago

Question Need advice on responsive scaling for an 8-player HTML/CSS poker table

1 Upvotes

Hi everyone,

I'm developing a browser-based 8-player Texas Hold'em poker table using HTML, CSS, and JavaScript.

The desktop layout works well, but I'm struggling with responsive behavior on mobile devices in landscape orientation.

Current setup:

  • Desktop layout with 8 player positions around an oval poker table.
  • Mobile landscape viewport tested at 956×440.
  • An internal game scene that uses scaling and absolute positioning.
  • Multiple CSS media queries and responsive overrides.
  • JavaScript handles player rendering and card positions.

Main problems:

  1. Dealer, Small Blind, and Big Blind badges are disproportionately large on mobile.
  2. Community cards appear too large.
  3. The top player's avatar and cards sit too low.
  4. Some elements scale correctly while others don't.
  5. Fixing one screen resolution sometimes breaks another.

What I'm trying to achieve:

A consistent responsive layout that preserves the relative positions and proportions of all table elements across desktop and mobile landscape screens.

My questions:

  • Would a single fixed logical coordinate system with CSS transform: scale() be appropriate?
  • Should I use CSS container queries or clamp() for individual elements?
  • How can I avoid conflicts between existing media queries and transforms?
  • What's the best way to anchor player seats, cards, and badges relative to the table?

I want to improve the CSS architecture without changing the underlying game logic.

I can share desktop/mobile screenshots and a minimal reproducible HTML/CSS example.

Any suggestions or examples would be greatly appreciated. Thanks!


r/css • • 2d ago

Question Colors won't render on desktop (VS Code / Phoenix Code) at all, but work perfectly on mobile. Any ideas?

Post image
2 Upvotes

r/css • • 2d ago

Question Inquiry on a skin for Google Docs

1 Upvotes

I would like to make a skin for Google Docs, I was thinking of making one with Stylus but I have just recently gotten into coding and such and am quite struggling with figuring how to do it, would anyone be able to give me any advice?


r/css • • 2d ago

Article Modern CSS Might Make Your Front-End More Complex

Thumbnail
smashingmagazine.com
0 Upvotes

r/css • • 3d ago

Question How important is it no be advanced in base CSS if I already know how to use Tailwind pretty well?

0 Upvotes

Hey guys! I am doing my master's degree in Computer Science, and like to develop web applications full stack. When it comes to FE, I normally use React with Tailwind CSS, because it even feels fun to style everything with it. I can visualize the structure of the web page I am styling better that way.

I started a hobby project, in which I planned to return to using the base version of CSS, without any extra, just like I learnt it in university. I know the basics pretty well, which was why I ultimately chose to move on to exclusively using Tailwind more than 1 year ago.

The problem is now, that I feel like suffering while I write basic CSS. Styling components take minimum 2x as much as I would normally spend on it. Every page I tried to style so far comes out ugly and it makes me question if I knew how to use CSS to begin with.

That being said, let's say for interviews, how important it is to be able to come up with base CSS code on spot? Should I stick with Tailwind or improving on base CSS code writing?


r/css • • 3d ago

Question modern css schooling

Thumbnail
reddit.com
0 Upvotes

r/css • • 3d ago

Help Our code vs our results :|

Thumbnail
gallery
0 Upvotes

Does anyone have any ideas on what to do? I followed his instructions exactly and I’m getting different results.


r/css • • 3d ago

Help Need help with figuring out code

0 Upvotes

Hi, I'm not good with coding what so ever just managed to change css code colors somewhat easily with my friends help, neither of us good are good at coding. If you could look at the code and tell me how I could make this be a legit thing with the colors id appreciate it!

I am not sure if it helps but the colors I used are:

.white-border {
    background: #faeeb7 !important;
    stroke: #faeeb7 !important;


.white-fill {
    fill: #faeeb7 !important;
}

    background: linear-gradient(to bottom, #f59454, #f8d17c);
    color: #faeeb7;
    border-radius: 16px;
    border: solid 4px #a56608;

.bottom-border .separator-1 {
    height: 4px;
    background: #a56608;
    border-radius: 10px;
    width: 100%;
}


.bottom-border .separator-2 {
    height: 4px;
    background: #a56608;
    border-radius: 10px;
    width: 100%;
    margin-right: 16px;
}

.username {
    padding: 6px 32px;
    background: #fff5de;
    border-radius: 64px;
    display: flex;
    color: #ffc549;

Just trying to give honey vibe ig :"D

Edited attempt
Original

(this is a f2u chat widget. Link: https://vtuber-nook.com/asset/1039/f2u-heart-shaped-chat-widget-for-streamelements/ I take no claim of this I simply just wanted to make it more customized to my own needs) (and I'm sorry if this is really dumb I just need help and I have no idea how to even look this issue)


r/css • • 4d ago

Article modest-ui: classless CSS that styles plain HTML

Thumbnail
reddit.com
4 Upvotes

r/css • • 5d ago

Article Make Cards Fit The Space They Actually Get

Post image
6 Upvotes

r/css • • 5d ago

Article Giving AI Agents a Better Way to Debug CSS

Thumbnail
amitmerchant.com
0 Upvotes

AI agents are getting better at writing CSS, but debugging it is another story. What if they could inspect the browser, understand why a style isn't applying, and fix the actual problem instead of guessing?

I explored how we can give AI agents a better way to debug CSS using browser insights.

Read the article.


r/css • • 5d ago

Article I built a CSS framework where class names read like plain English — would love honest feedback

Thumbnail reddit.com
0 Upvotes

r/css • • 5d ago

Question "X" di chiusura menu mobile

0 Upvotes

Buongiorno a tutti, mi è capitato che il codice content: "X" !important; su alcuni browser tipo firefox o chrome viene convertito in content: "&#10005;" !important;, ho risolto mettendo content: "\00D7" !important; nel css custom.


r/css • • 5d ago

Question How to adapt height to be the same as another element?

3 Upvotes

I'm taking my first CSS/HTML course for my degree, and it's my first introduction to coding, so apologies if this seems like a silly question.

I've been trying to figure out how to style an element to be the same height/weight as another element when they aren't in a parent-child relationship. I'm thinking maybe there's a calc or var function that might work...?

For reference, I've included a photo of my Figma mockup as an example. My goal is to make the pink line the same size as the paragraph. This section is repeated on multiple pages, but the paragraph of text is different on each, so I'm hoping to save time by making it variable instead of creating a class or ID for each page.

Hoping any of this will make sense to someone so I can get some advice. Thanks for the help!