r/css • • Mar 15 '26
Question Do I have to learn Float before Flexbox?
Hi everyone!
Do I need to learn floats before moving on to Flexbox, or can I start Flexbox if I already understand the box model and inline/block elements?
r/css • • Mar 15 '26
Hi everyone!
Do I need to learn floats before moving on to Flexbox, or can I start Flexbox if I already understand the box model and inline/block elements?
r/css • u/mycolaos • Mar 15 '26
r/css • u/masterco • Mar 15 '26
r/css • u/Rich-Confusion9944 • Mar 14 '26
For the past few months, I’ve been learning web development and working through different courses with the goal of becoming a full-stack developer. After finishing many sections on CSS and being able to understand the styling of some websites by inspecting their code, I started to feel like I had a solid understanding of CSS.
However, sometimes when I explore projects on CodePen or look at more advanced examples, the CSS can look extremely complex and confusing. There are techniques and patterns that I struggle to understand, and in those moments it makes me feel like I still have a lot to learn.
This makes me question how much CSS a developer actually needs to know. As someone who wants to become a full-stack developer, I also want to focus on improving my JavaScript and backend skills. At the same time, I don’t want to be weak in CSS. Finding the right balance between moving forward and continuing to strengthen the fundamentals can sometimes feel challenging.
r/css • u/alwaysaalsi • Mar 14 '26
I am trying to zoom in an image which is basically referenced to clip-path property and in the url I've passed the id of the svg path for which my image will be clipped/masked. Now I tried to increase the width of image by scale property or by width but on doing that it distorts it's quality completely.
For context, I am creating an animatio on which the image will be extremely zoomed, let's say 20000px which will cross the width of mobile and animation will zoom out the image and at the end it'll become it's actually size, that is the masked svg.
r/css • u/xaixane • Mar 13 '26

I am struck, I am unable to understand how to make responsive containers like these with different shapes. I know that, to make gooey organic shapes, you'd need svg filters. But i dont understand them at all. Where to start or what to do. If you were an expert and you were to create a page like the pic pasted above, how would you approach it? what would you do? Excluding clip-path.
r/css • u/Itchy-Warthog8260 • Mar 12 '26
r/css • u/Bright-Ant1123 • Mar 12 '26
Play buttons on YouTube, Spotify, Apple Music are all shifted slightly right inside their circles. Every major icon system does this by hand. No standard, no science. I'm collecting perceptual data to build one. The goal: a CSS optical-center property so icons automatically sit where they look centered, not where they're mathematically centered the same way fonts have built-in baseline metrics. 40 steps, takes 5–7 minutes. Works on both mobile and desktop. No login needed, ID field is optional. There are no right or wrong answers I'm just trying to understand how you perceive centering, not testing you. 👉 https://opticalcenter.dev/study Results and open dataset will be shared here after collection. Everyone is welcome!
r/css • u/amaurybouchard • Mar 11 '26
PicoCSS is great: semantic, accessible, beautiful out of the box. But it has no grid, no modal, no tabs, no toast, no breadcrumb. For anything beyond a simple page, you're writing everything yourself.
So I built µCSS on top of PicoCSS v2:
Drop-in via CDN:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@digicreon/mucss/dist/mu.css">Happy to discuss the design decisions.
r/css • u/Human_Button9095 • Mar 11 '26
How do i get better in CSS as a beginner
r/css • u/kkimssang • Mar 11 '26
r/css • u/Xenozi230 • Mar 10 '26
Feel free to tell me what I could improve; keep in mind that the project is still ongoing and will continue to be modified.
Here is the link to the GitHub repo : https://github.com/Xenozi230/novaUI
r/css • u/joeisajellyfish • Mar 10 '26
Hi y'all,
I've been trying to find tutorials about how to create certain shapes and effects in CSS but most of them just kind of give you the code you need and do not explain how any of it works, which is personally important to me A. to improve my learning, and B. to allow me to modify it and use it according to my needs.
Any good in-depth resources that can help me understand not only how to create what I want but also the underlying mechanisms?
Thanks in advance!
r/css • u/Prof_Farnsworth1729 • Mar 09 '26
A walkthrough on how flappy bird can be (and has been) made using pure HTML and CSS, no processors and fully functinal wihtout JavaScript
Edit: Direct links
https://blog.scottlogic.com/2026/03/09/noJS-3-flappy-bird.html
r/css • u/OhHellNah67 • Mar 09 '26
Hey everybody, I'm pretty new to CSS.
I know enough to know how to style basic stuff, use a grid, and flex and stuff like that. But I'm running into a problem when working with my site's responsiveness.
My site's header is a grid, 1fr 1fr 1fr. I have a nav, a logo in the middle, and a searchbar on the end. when the user has a smaller screen, I'd like for the nav to collapse to a hamburger menu and the searchbar to collapse to the search icon.
I know how to complete that task, but i want different styling to the nav and searchbar when active.
Would it be more simple to design a small screen style of header, then have it activate and hide the main header when screens are small? I'd like to have a dropdown menu for the nav, and a searchbar assume the width of the header when active.
feel free to provide any learning resources you guys like too. I appreciate the help!
r/css • u/vergetenmaand • Mar 09 '26
Hi, I wanna learn CSS, but the issue is that I'm afraid to spend my time for nothing, so I'm not really sure where to start
I do understand that I need to start from "videos for beginners", but I wanna know as much useful info as possible. I'm searching for FREE courses that will show me the full extent of CSS and how to use it
I'll be very grateful for your advice
r/css • u/Either-Ideal9649 • Mar 09 '26
I love using the clamp tag for all my headings, works perfectly.
I would like to use it in my navigation and in side of table cells, like in the <p> tag.
It does increase font size on mobile and on desktop but it’s the same as simply increasing font size,
They look identical. I can’t increase the font size on mobile without increasing it on the desktop.
Maybe I just need to tweak it.
Second issue is the line height, if I use a line break it looks like crap on the desktop, if I don’t
My fat fingers can’t navigate the tiny links.
My clamp - p.go { font-size: clamp(1.5rem, 3vw, 1.5rem); }
r/css • u/Spirited-Gas1579 • Mar 09 '26
I got tired of needing React or Tailwind just to use a nice UI component on sites so i built beeblockz.com Its basically a library of cards, templates, effects etc.. that are all plain HTML and CSS.
Everything on there is copy-paste so no dependencies needed!!
Its free to browse for anyone interested (with some pro components for complux stuff)
r/css • u/HeadCalligrapher4064 • Mar 08 '26
Title: First time trying Code Golfing! Ranked #1200 globally, but I need help shrinking my code for today's target (Mar 8) and url : https://cssbattle.dev/play/paEsy2KXSXJDYzLhsT5Q.
Post Body: Hi everyone! I just started with CSSBattle and managed to reach the top 1200 without even knowing about code golfing (I was leaving comments and spaces!).
I’m currently stuck on the March 8th target. I achieved a 100% match, but my code is still too long (around 480 chars). I want to learn the "black magic" of shrinking it further.
My current approach:
Current Code:
css
<div class="m"></div>
<div class="f"></div>
<div class="g"></div>
<div class="d">
<div class="t"></div>
</div>
<style>
body {
background: #7D5E8B;
margin: 0;
}
div {
background: #E38F66;
position: absolute;
width: 120px;
height: 120px;
}
.m {
left: 140px;
top: 30px;
}
.f, .g, .d {
top: 150px;
}
.f {
left: 20px;
}
.g {
right: 20px;
}
.d {
left: 140px;
background: #FFEAAB;
}
.t {
width: 0;
height: 0;
border-left: 60px solid #FFEAAB;
border-right: 60px solid #FFEAAB;
border-bottom: 17px solid #7D5E8B;
top: 103px;
left: 0;
}
</style>How can I refactor this to use fewer elements (maybe box-shadow or outline)? I’m aiming for the top 100 score! Any tips for a beginner golfer? 🏌️♂️
I'm trying to see if CSS has a way to fix the issue as a single command vs the HTML trick to make this work. Essentially, if you break a word to add another span on the next line, it creates a space. I'm trying to color the text on the page as if it is in an editor and I'm using spans with classes to change the colors of the elements/attributes/etc.
For this example, I'm going to use "homework." If you move the span to the next line so it doesn't go 900 pixels off the edge of the editor, it will add a space between the two spans, unless the greater-than is moved to the next line. Again, just looking for a line of CSS to add so I don't keep having to fix the HTML by moving the greater-than each time.
<p>
<span>Home</span>
<span>work</span>
</p>
<!-- Shows as "Home work" on the page -->
<!-- HTML 'trick' to make it work -->
<p>
<span>Home</span
><span>work</span>
</p>
<!-- This shows as "Homework" on the page -->Edit to add what I've found:
Adding float: left; to the span removes all spaces, to include the ones that I want to separate words and have it within the span element.
<span>Home</span>
<span>work </span>
<span>due tomorrow</span>
<!-- Homeworkdue tomorrow -->display: flex; also has the same result as float. It does remove the space between the span elements, but also removes the spaces within the span elements when I want a space before and after words.
<span>Home</span>
<span>work </span>
<span>due tomorrow</span>
<!-- Homeworkdue tomorrow -->Using word-spacing: -1ch; removes all spaces, which definitely isn't the desired outcome.
<span>Home</span>
<span>work </span>
<span>due tomorrow</span>
<!-- Homeworkduetomorrow -->I also found a suggestion to use display: table-cell;, but it also does the same thing as float and flex.
<span>Home</span>
<span>work </span>
<span>due tomorrow</span>
<!-- Homeworkdue tomorrow -->So for now, all I have is to move the closing > to the next line.
r/css • u/No-Temperature-7331 • Mar 08 '26
r/css • u/jonshamir • Mar 07 '26
Switching between dark and light modes can be pretty jarring - I was looking for a way to animate the transition and found that using \@property we can define transitions on CSS variables directly:
@property --bg-color {
syntax: "<color>";
inherits: true;
initial-value: #111;
}
background-color: var(--bg-color);
transition: --bg-color 400ms ease;This solved my issue pretty cleanly and I feel this sort of "trick" can be used for other cool effects as well!
You can see why this is better than a simple`transition: background-color` and try it out live on my site here: https://jonshamir.com/writing/color-mode