The key with CSS is practice. There's absolutely nothing complex in it. Just takes time. Get a lot of practice building practical and useful/ real-world UIs . As a backend dev who made the switch to frontend, I absolutely
DESPISE CSS.
Love the JS, tho. It's the only part of frontend that you can call programming.
View attachment 918079
But, spend enough time doing it and it becomes second nature. You'll look at a design and figure out the CSS on the spot. Of course there can be hiccups in implementation sometimes but you get the point.
On a more technical note, try to divide the CSS part of a UI into layout/structure and design/styles. First build a skeleton of the UI. Probably the only properties you'll need to understand for this is
display and
position. Display is simple enough except some advanced ones i.e. Grid display is hard for beginners to grasp.
Position on the other hand can give you the most confidence if you master it. It's also the most pain in the a*s part for most beginners.
Also, most people who are decent with CSS still don't understand the importance of good markup. Good HTML often makes writing the CSS significantly easier. This is hard to explain but it'll come naturally as you progress. You'll notice your markup improve as your CSS improves.
For the design/styles part, their is less to do with concepts and more with memorization. tt's very easy and you'll just need to familiarize yourself with the properties and values. Once you've done something a couple times, it's pretty easy to grasp and use later on. Doesn't take nearly as much effort as building layouts.
Learn about the common css tricks etc. If you are working by yourself and don't have a mentor, Youtube and csstricks are a great source.
Then there are general standard practices, like UIs should be scalable. Reduce redundancy. Use CSS variables as much as you can. Learn the less commonly used selectors (can't stress this enough). They can be life savers and can take your ability to a whole new level.
W3schools gets a lot of flak but it can take you a pretty decent level in a short time. Don't worry about any crap your read on stackoverflow etc. You don't want to delve into MDN as a beginner. It'll wear you out than do you any good. W3Schools is great for beginners. As your skill level increases and you are working with advanced/complex stuff, you'll automatically find yourself using more comprehensive and authoritative sources where w3schools doesn't cut it. But, as a beginner, don't overwhelm yourself.
And that's all there is to CSS. For the most part, you'll only be having trouble with JS, and CSS will come naturally with time.
EDIT: most of the answer recommending OP to look into scripting languages and ML/AI when he is asking for help with beginner CSS stuff remind me of this hilarious meme.
View attachment 918077