🐿️
12

TIL I was writing CSS selectors backwards for 6 months

I kept wondering why my styles would never apply the way I wanted, especially in things like div h1 p. I would stack them thinking the first one was the most important. Then a buddy glanced at my screen and said 'dude, you're reading that from right to left, not left to right.' He showed me how the browser reads the last element first, and suddenly all my broken layouts made sense. Has anyone else had a facepalm moment like that with some basic coding concept?
1 comments

Log in to join the discussion

Log In
1 Comment
brianellis
brianellis11d ago
Man that's rough... but honestly I bet half of us have done something like that and just never had anyone call us out on it.
4