Reading view

question to understand the logic behind using CSS

hi! I didn't think I'll need that in my life, but I very need to know how to use CSS properly. I mean what are the differences between one thing and another, what's more popular to use etc. So, I'm trying to relearn CSS.

For the context: I learned CSS in 2022 only to pass the exams and that's all, and then I was like "yahoo! I won't return to the web design ever again!". So, I can use the atributes with classes, id etc, but I can't understand what are the important things to properly use them. I didn't think I'll need to program projects related to web programming. I find JS and PHP quite easily to understand, bcz every thing has one meaning there. It was a bit hard to understand HTML for the first time, bcz I thought every tag has its own function, but when I understood that plenty of tags are semantical and I can just use <div> and <span> if I want, I started to use the semantical tags properly. CSS is the hardest part in Front-End for me, bcz Idk if plenty of things are similar to the HTML ones(an atribute is optional and it depends on you if you want/need to use that) or the programming languages(1 thing = 1 meaning).

Here are my questions about CSS to understand it better:

  1. which position is the best? Bcz usually I used "position: absolute";
  2. why to use the coordinates(except for the z-index) if you have the margins?;
  3. why a lot of web developers prefer to use the paths from a vector image instead of uploading the .svg file itself?;
  4. what to use: the standard shadow or something like "filter: drop-shadow(10pt 10pt 6pt);"?;
  5. I liked the grid, but I saw a lot of developers use flexbox. Is it important to choose one thing over another or is it something optional?;
  6. are the CSS similar, but different atributes important only for the browsers?;
  7. what's the point in making something like "p.name1 {}", when I could just create a new class?;

I hope I didn't forget anything, but if I did, I'll make a new post about them

Edit: I can't change the title, but I meant questionS*

submitted by /u/Konnnore to r/Frontend
[link] [comments]
  •  
❌