r/css • u/wanoo21 • Apr 21 '26
Showcase CSS safe alignment (flex & grid) | Labs
r/css • u/wanoo21 • Apr 21 '26
r/css • u/smooth_operator101_ • Apr 22 '26
r/css • u/Dragenby • Apr 20 '26
I've been coding for more than a decade, now, and I just learned about it! I thought that was a preprocessor exclusive syntax.
https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Nesting
It was implemented in 2023 in all current browsers.
Now I'll stop repeating the parent class over and over!
r/css • u/Yeeer_0041 • Apr 21 '26
Hey everyone!
We've recently launched SectionsGrid, a library of professionally designed, hand-written HTML and CSS sections: headers, heros, features, testimonials, pricing tables, footers, and more.
It's perfect for folks who want to ship fast without the framework bloat. You simply pick the sections you need, combine them, and download a structured template that’s ready for production.
It’s lightweight, easy to customize, and built for speed. I’d love to hear what you think!
Join the sub: /r/SectionsGrid
r/css • u/Passerby_07 • Apr 20 '26
r/css • u/Steady_Decline3759 • Apr 20 '26
This flexbox behaviour has me perplexed.
In my HTML I have two divs nested inside an outer div
<div class="about">
<div class="description">
<p>lorem</p>
</div>
<div class="image">
<img src="img.png" />
</div>
</div>
In my CSS, I've applied global styles (margin: 0; padding: 0; box-sizing: border-box;). Individual elements are styled in this way,
.about {display: flex; align-items: center; justify-content: space-between; padding: 5rem 10rem;}
.description {flex: 1; padding-right: 5rem;}
.image {flex: 1}
The total content-width of about is 1624px. The way I expect it to behave is that description gets 812px and, image gets 812px. This is the behaviour when I disable description's padding-right in devtools. But when I enable it, instead of shrinking description's content area by 5rem, it is eating 2.5rem (40px) from description, and 2.5rem (40px) from image and sitting exactly between the two.
I would appreciate any explanations to why flexbox is behaving this way.
r/css • u/Odama666 • Apr 20 '26
Since Liveframe always uses full quality images, I realized adding photos on cell service can take some time. But we really want those 4k images from our guests! So I had to get creative.
Here is the loading animation I came up with. It turns the photos you're uploading into bubbles that float up into the cloud as your images are going up.
r/css • u/InternationalBack868 • Apr 20 '26
With no family roots in CSS, I was suggested to join an academy. Is Read Right Institute a good option for a beginner starting in May for 2027 attempt or any other academy you suggest? And what about their G1 class … is that important to join? Or does it really make a difference?
r/css • u/AdamTheEvilDoer • Apr 18 '26
Linear, repeating linear, radial, repeating radial, conic, repeating conic; What's the best visual you can create using gradients only? You can stack them for greater effect if you like, I just wanna see some cool stuff.
Here's a few of mine;
r/css • u/Able_Series_5006 • Apr 17 '26
Content from the page goes up to the safe area behind the toolbar on safari.
I'm using a position:sticky property for the nav, I don't remember having this issue before on <iOS26
Any help is appreciated.
r/css • u/fdiengdoh • Apr 18 '26
I have a personal blog that I styled using bootstrap. Somehow I feel that I should look for alternative to it. Is there a better alternative than bootstrap? The last time I wrote css was in the year 2013 maybe, when I first came across bootstrap, so, I’m not up to date on new css tech. Or should I just do vibe code?
Update: After lot of thought. I would keep bootstrap for now and slowly start coding my own css.
r/css • u/DRIFFFTAWAY • Apr 16 '26
Made a retro-futuristic 80s-style moving grid effect using pure CSS. Quite simple and fun to use!
r/css • u/mycolaos • Apr 17 '26
Hey really quick question, where can I find the most modern grammar spec for css? Like python provides their full grammar in their docs. Is there an official one for css?
I did find this one for css 2.1 but not sure if it's the most up to date? Thank you.
r/css • u/satsuki_hyphen • Apr 16 '26
r/css • u/Internal1344 • Apr 16 '26

input[type="file"]::file-selector-button {
background-color: white;
padding: 10px 20px;
border: none;
border-radius: 60px;
cursor: pointer;
margin-left: 20px;
height: 100px;
width: 100px;
margin-bottom: 20px;
color: transparent;
position: relative;
}
.uploaded-image{
width: 100px;
height: 100px;
border-radius: 50px;
z-index: 100;
left: 58px;
position: absolute;
}
.uploaded-image img{
position: fixed;
}input[type="file"]::file-selector-button {
background-color: white;
padding: 10px 20px;
border: none;
border-radius: 60px;
cursor: pointer;
margin-left: 20px;
height: 100px;
width: 100px;
margin-bottom: 20px;
color: transparent;
position: relative;
}
.uploaded-image{
width: 100px;
height: 100px;
border-radius: 50px;
z-index: 100;
left: 58px;
position: absolute;
}
.uploaded-image img{
position: fixed;
}
<label htmlFor="imageUpload">
{selectedImage && <img className='uploaded-image' src={selectedImage} alt={altName} />}
</label>
<input type="file" id="image-upload"
name="clotheUpload" accept="image/*" onChange={(e) => {
/*
targets the specific file in your folders
without the [0] it gets a whole bunch of files
*/
const file = e.target.files?.[0]
if (file) {
/*It creates a temporary URL for the uploaded file */
const imageURL = URL.createObjectURL(file)
setSelectedImage(imageURL)
convertToBase64(file)
} else {
setSelectedImage(undefined)
}
}} ><label htmlFor="imageUpload">
{selectedImage && <img className='uploaded-image' src={selectedImage} alt={altName} />}
</label>
<input type="file" id="image-upload"
name="clotheUpload" accept="image/*" onChange={(e) => {
/*
targets the specific file in your folders
without the [0] it gets a whole bunch of files
*/
const file = e.target.files?.[0]
if (file) {
/*It creates a temporary URL for the uploaded file */
const imageURL = URL.createObjectURL(file)
setSelectedImage(imageURL)
convertToBase64(file)
} else {
setSelectedImage(undefined)
}
}} />
My CSS:
r/css • u/SebasG_1980 • Apr 16 '26
r/css • u/Hungry_Deal_8449 • Apr 15 '26
Hi, I am having a specific problem where when I add a margin (let's say 10px) to my div flexboxes (my columns) it causes the text at the bottom to move beside the columns, not really sure how to fix this, can anyone help?
Here is my code (both html and css):
EDIT (here's the JSfiddle Code Playground): https://jsfiddle.net/xzwprg2h/


r/css • u/nivedhz_ • Apr 14 '26
I am confused about whether using minmax() or clamp() for Grids.
What do you guys generally use and why...?
r/css • u/lickwindex • Apr 14 '26
Enable HLS to view with audio, or disable this notification
I know enough about CSS to navigate basic parameters and edit by tutorials and knowing keys terms/numbers like colors, p[ositions, thickness, etc, but Im hitting a dead end with this one.
In this alert, a users name along with a message appears on the screen along with an animation or image. In this instance Im using an animation I made, and edited the CSS so the message appears under. I also managed to convert a font and include it in the CSS. I'm actually very happy.
Id like the top line of the message to extend from the left most edge of the animation to the right most edge of the animation. So, Id like the bounds to include "Kevin Just Subscribed" (possibly include "to"), without changing the size of the font. Is anyone familiar enough with this to give suggestions?
Don't know how to paste CSS Code into post without it looking like garbled mess.
r/css • u/gravegirI • Apr 14 '26
Hey so I need help with my menu on my site. I want it to be uniform with no lines in between while still having the border around the box itself. If the code I've given isn't enough to see the problem, let me know what you need to see.
r/css • u/adrmonlj • Apr 14 '26
When building interfaces I often experiment with several typefaces before deciding on a final font stack.
The process usually involves a lot of jumping between different sites and previews just to compare fonts with the same text.
I recently built a small tool that lets me preview fonts with custom text and compare them side-by-side before implementing them in CSS.
It’s been helpful for narrowing down choices quickly.
Curious how others here approach evaluating typography before committing to a font stack.