/r/css

Photograph via snooOG

A community for discussing about CSS (Cascading Style Sheets), Web Design and surrounding relevant topics. Feel free to discuss, ask questions, share projects and do other things related to CSS here.

About CSS
  • CSS, short for Cascading Style Sheets, is used almost universally across the web to affect the design and appearance of every website you visit. Here in /r/css, you've got a place on reddit to talk about CSS, whether you're new to CSS and want to learn, or a pro wanting to discuss the engineering and usability reasons that all modern browsers ignore

  • We welcome all CSS discussion here. If you need help with styling your website or your reddit, or want to share a neat trick you cooked up, it's welcome here!

Rules
  1. No spam. If you've developed a neat CSS trick that you want to share with others, make sure you share the trick, not your website. In other words, feel free to post something like "Isn't my 404 page neat?" with a link, but avoid posts like "Hey look how cool my site is!" that link to a storefront. This reddit is a place to learn and show off CSS, not sell your products. If your CSS helps sell your product, great, but make sure your post is about the CSS, not the product.
  2. Be nice. Not everyone is a fantastic designer. If someone posts their work here and you don't like it, give them objective feedback about ways to improve it, not "it's ugly." Likewise, CSS newbies often have the same questions as they grow and learn, so try not to be mean when they post a question we've seen a thousand times before. It might be old news to you, but they wouldn't ask if they hadn't already sought an answer, and there might be other people too afraid to ask for themselves.
  3. Don't use link shorteners (bit.ly for example), because they are automatically marked as spam.
  4. Try to use descriptive titles (not 'I have a question.'). I won't enforce this, but it'd be nice if you'd follow it.
Related subreddits
Useful Links
  • Inspire, a collection of all kinds of useful links.
  • /r/csshelp and /r/reddithax are the places to go for questions relating to Reddit's stylesheets. Techniques differ a lot between formal CSS development and subreddit stylesheets, so you'll often get better answers there.
  • Use Codepen or jsFiddle to provide working code samples.
  • Mozilla Developer Network is your one-stop shop for detailed information on CSS properties. Formal specifications for everything CSS can be found at W3.org. Don't go to W3Schools - it isn't a wiki maintained by real developers like MDN, so it's often out of date and prone to significant errors, and it has no relationship with the W3 so they have no special or insider knowledge.
  • CanIUse.com has 99% of the information you need on supporting different browsers.
  • Codecademy can get you started from 0 knowledge of web development in mere hours.
  • Learn Layout will teach you advanced techniques for designing modern sites.

Click here to message the mods.

/r/css

126,958 Subscribers

1

GSAP Animation issue!

3 Comments
2024/11/18
06:40 UTC

1

How is my design

2 Comments
2024/11/18
04:30 UTC

1

my new design

0 Comments
2024/11/18
04:30 UTC

0

How can we animate a grid area?

Hello, I'm working on a section of a project where I need to start grid items from one position and then move them back. I've tried various approaches, including changing the grid area، the items just pop at the other side. My next idea is to determine the grid item's original position, place it at the starting point, and then transition it back to its intended position. However, I'm unsure if this will work. It's similar to a card stack where I want to distribute each card to its position with smooth transitions.

3 Comments
2024/11/18
01:54 UTC

0

CSS issues

How can I make my page look better

10 Comments
2024/11/17
22:48 UTC

0

how to call my images (all at once) in css

this is my html part:

 <div class="gridss">
            <a download="double1.jpg" href="/PO/images/galaxies/">
                <img src="/PO/images/galaxies/double1.jpg" /></a>
            <a download="galaxy1" href="/PO/images/galaxies/galaxy1.jpg">
                <img src="/PO/images/galaxies/galaxy1.jpg" /></a>
            <a download="galaxy2.jpg" href="/PO/images/galaxies/galaxy2.jpg">
                <img src="/PO/images/galaxies/galaxy2.jpg" /></a>
            <a download="m82.jpg" href="/PO/images/galaxies/m82">
                <img src="/PO/images/galaxies/m82.jpg" /></a>
            <a download="sobrero.jpg" href="/PO/images/galaxies/sobrero.jpg">
                <img src="/PO/images/galaxies/sobrero.jpg" /></a>
            <a download="whirlpool.jpg" href="/PO/images/galaxies/whirlpool.jpg">
                <img src="/PO/images/galaxies/whirlpool.jpg" /></a>
        </div>

do i call my css::

.gridss {

height: 100px;

width: 100px;

}

because when i do that, nothing is affected. so what do i replace with .gridss to make all the images/anchors be adjusted to the css? also yes, my css is well linked

6 Comments
2024/11/17
22:00 UTC

0

Alguna forma de hacer un max width/height facil

6 Comments
2024/11/17
12:24 UTC

0

Geo Hero Text

Good Evening,

I'm wondering how to create a geo-specific Hero text on my page. The page in written in WordPress with Elementor.

for Instance, if someone would log in from New York it would say - Hello there in [Geo Text] (Hello there in New York]

Im a beginner in all thins and would like some direction.

5 Comments
2024/11/17
00:48 UTC

0

Software

Is there any better software then dreamweaver Becase for some reason that software doesn’t update when I make changes

10 Comments
2024/11/16
16:20 UTC

4

bacbackdrop-filter property

Hi , I'm developing an Obsidian theme -which is note taking app- and implemented backdrop-filter:blur(5px) in certain areas. While it performs well on desktop, the theme feels sluggish and heavy on mobile device , Is backdrop-filter that resources intensive ?

2 Comments
2024/11/16
14:18 UTC

2

slider animation, i intend to use attr to collect the data instead using a variable for each element.

2 Comments
2024/11/16
13:11 UTC

1

Image Floatie that opens up a contact form? (Blogger)

Hi! I hope this is the right place to post this. I had an idea for my blog where I have a floatie image that says "Mail me", which when you click on it will open a small window with a contact form. However, I just can't figure out where to even start. Does anyone have any advice? So far I have the floatie image working, but how to add the intended function to it is beyond me.

7 Comments
2024/11/16
12:53 UTC

1

What is this editor called?

I’m looking for an editor that allows me to view the HTML code together with the corresponding linked CSS for easier styling and editing. I saw it on github but couldn’t find it ever since. Reminded me of ComfyUI.

10 Comments
2024/11/16
12:00 UTC

17

Any tips on how one can create a small infobox with borders like these?

12 Comments
2024/11/16
05:53 UTC

2

CSS html

If you redo your css from scratch do you have to look at the other html pages to make sure they have the right info ?

3 Comments
2024/11/16
00:36 UTC

3

Can you declare multiple @container blocks for one set of styles?

I have a widget that will use different container breakpoints depending on a class being set.

So, to start with, something like this):

@container containerName 800 (width > 800px) {
  ...a bunch fo CSS Here...
}

That works fine. Anyone using this widget that wants it to reformat when the container gets to be 800 adds a class that defines that container name.

I'd now like to make this a bit more versatile and let users pick from another of breakpoints when using the widget. So would like something like this:

@container containerName 800 (width > 800px),
@container containerName 700 (width > 700px),
@container containerName 600 (width > 600px) {
  ...a bunch fo CSS Here...
}

But that doesn't seem to work. Is there a way to do this with different syntax?

I could, of course, just repeat the same block of CSS in 3 separate container blocks, but that's obviously repetetive and a pain to maintain.

7 Comments
2024/11/15
23:35 UTC

0

Alternative to the Pesticide Chrome extension

The Pesticide Chrome extension does not work anymore. Is there an alternative? This neat little extension allowed you to see all the borders on a page.

1 Comment
2024/11/15
20:25 UTC

3

Ther's an effect that I'm trying to achieve and I don't know what it's called

I want to be able to create an indent in a div on hover. when i hover over the div, a small portion of the div recedes into the div or "disappears" to make room for somethign else.

I tried to recreate this idea in figma but i have no idea how. any ideas?

5 Comments
2024/11/15
17:53 UTC

3

Need help to understand positioning

Hello everybody, I am a beginner and was trying to center some images in a mini project I'm working on and realized that moving things around with margin is not ideal so I checked MDN Web Docs for better alts. I concluded to the solutions you see in the screenshot. I have a gut feeling that they are not ideal either but I want to try understanding them at least.
I learned from MDN docs that place-items is a shorthand for align-items and justify-items, and that place-content is a shorthand for  align-content and justify-content. So I played around with those base properties and discovered that only align-content and justify-items works.

Why is that?

And please if you have a better way of positioning that is beginner friendly I would be grateful for the share.

https://preview.redd.it/kr0wsfbeq31e1.png?width=1366&format=png&auto=webp&s=545de2ca3f006b0ef708b98a51b984ff170018d8

UPDATE:

I still don't fully get the "why" but at lease I get the "how" now. This is what I came up with:

Notes

Demo

14 Comments
2024/11/15
17:46 UTC

4

Learning css

Is it normal to feel frustrated over css im about 2 months in from week 13 ?

22 Comments
2024/11/15
16:29 UTC

2

How do I start learning CSS?

I really want to learn CSS but I have no clues how. I don’t even know where to code it, or how to. I’m really eager to learn it so I could make websites, I have some basic knowledge of HTML since we had to do that for a year in grade 8. (I’m currently in grade 10). Any help?

23 Comments
2024/11/15
12:28 UTC

0

I spent 4 hours looking for a CSS selector and I'm not sure what I'm doing wrong.

I am attempting to locate a CSS selector for a specific HTML sample, which is referenced below. My goal is to extract only the text content of a LinkedIn post, excluding all hashtags. I have experimented with numerous CSS selector variations and utilized various automatic CSS selector generators. Despite spending 4 hours on this task, I have been unable to find a solution. I am trying to get the content of a LinkedIn post without any accompanying hashtags.

I am not sure if this is a simple or elaborate task but I assume coming up with a selector would be relatively easy for someone who is a full-on front-end developer that dabbles in CSS in their work. My background is mostly in the backend and I don't engage with much frontend work in my day-to-day workings.

For the last thirty minutes, I get headaches whenever I encounter anything resembling a CSS selector 😢. I'm prepared to work through this on my own but any guidance pointing me in the right direction would be immensely helpful in saving some time.

Here is the HTML sample: https://pastebin.com/UBJdUcAK

Here are some of the CSS selectors I've tried so far:

"div.feed-shared-update-v2__description-wrapper > div > div > span:not(a)"

"div.feed-shared-update-v2__description-wrapper > div > div > span > span span:not(.app-aware-link)"

".update-components-text a:not(.app-aware-link)"

".update-components-text.relative.update-components-update-v2__commentary a:not(.app-aware-link)"

7 Comments
2024/11/15
09:11 UTC

0

MY NEW DESIGN

2 Comments
2024/11/15
04:35 UTC

8

Why do all UI component libraries look the same?

I am in the market for ui component libraries in (mainly)tailwind css. The ones I’ve discovered (and they’re a lot - based on tailwind and others) look all the same - too much white space, gray borders and white background. They look like they’re build for touch interactions. I miss the ui designed for mouse pointers. Edit: Updated for non tailwind libraries also

8 Comments
2024/11/15
04:05 UTC

0

Help

I was wondering if someone who is experienced in css can dm me about issues I’ve been having with the page

6 Comments
2024/11/15
01:15 UTC

2

Shape-outside URL not working

Hey all, it's my first time using shape-outside property, when I use polygon or circle it works, but I couldt get it to work with url property

 float: right;
shape-outside: url(/public/hexample.png);

Thats how I try to use it

3 Comments
2024/11/14
23:48 UTC

7

How can I implement a calendar layout where events stack vertically, and can span multiple grid cells horizontally?

6 Comments
2024/11/14
19:39 UTC

Back To Top