Master CSS Spacing: Margin, Padding, and Gap Explained

  Рет қаралды 1,026

Dmitry Mayorov

Dmitry Mayorov

Күн бұрын

Пікірлер: 21
@DavidWaumsley
@DavidWaumsley 5 ай бұрын
Thanks so much for this. This is the kind of tutorial we need more of .
@Flyers8810
@Flyers8810 6 ай бұрын
real world examples, not just isolated demos are so so so helpful! Thank you!
@dmtrmrv
@dmtrmrv 6 ай бұрын
Glad it was helpful!
@adhipathis12
@adhipathis12 5 ай бұрын
Thank you, this helped me a lot. Please keep making more videos like these. 😄
@dmtrmrv
@dmtrmrv 5 ай бұрын
Glad it helped! Thank you :)
@adhipathis12
@adhipathis12 5 ай бұрын
@@dmtrmrv Hi, I have a request. Could you please make a video about the design tokens (such as --size-1) and the essential ones needed before starting a project? Also, could you create a video discussing the CSS reset you use? Thank you!
@dmtrmrv
@dmtrmrv 5 ай бұрын
@adhipathis12 Thank you for the suggestion! I'll def make a video on design tokens. Stay tuned!
@adhipathis12
@adhipathis12 5 ай бұрын
@@dmtrmrv thanks😀
@Pharmtechie
@Pharmtechie 6 ай бұрын
Thanks bro💯 Keep up the good work
@writerkatya
@writerkatya 6 ай бұрын
Thank you, it helped to solve my problem!
@kristoferpersson6751
@kristoferpersson6751 6 ай бұрын
This cleared a few things up for me, so thank you! 🙏 Is there a specific reason why you use "margin-block-start" instead of just "margin-top"? Subscribed!
@dmtrmrv
@dmtrmrv 6 ай бұрын
Happy to hear the video was helpful! Margin-block-start is a logical property, whereas margin-top is a physical one. I have a video planned about that, but in short, the first one is better because it supports different writing modes out of the box, like in the Japanese language, for example.
@lysak_coding
@lysak_coding 6 ай бұрын
Damn your english is so good
@dmtrmrv
@dmtrmrv 6 ай бұрын
Thank you
@NedumEze
@NedumEze 6 ай бұрын
Sorry Dmitry, "site__header site-header". What's with the site-header class? Is this another flavor of BEM? Familiar BEM would have "site--header" for a Modifier as "site__header is correctly the Element's class.
@dmtrmrv
@dmtrmrv 6 ай бұрын
Hey @NedumEze! Great question. I think it is easier to think like this There is a `site` block: site site__header site__main site__footer And three separate blocks: `site-header`, `site-main`, `site-footer`. The first one acts as a container, like a box that holds actual `site-header`, `site-main`, `site-footer` blocks or other elements. It's perfectly fine to set margins on `site__header`, `site__main`, `site__footer` because they aren't used on their own outside of `site`. I talk more about it in this video too: kzbin.info/www/bejne/h6bblWifg6qjY5Y I know it may be a bit confusing at first, but this structure is very robust. It allows for easy swapping of components inside the header, main and footer while keeping spacing consistent. Let me know if this answers your question!
@NedumEze
@NedumEze 6 ай бұрын
@@dmtrmrv Thanks @dmtrmrv. It does. I appreciate.
@dmtrmrv
@dmtrmrv 6 ай бұрын
@NedumEze you are welcome!
@romanperera
@romanperera 6 ай бұрын
margin-block* and padding-block* etc are new to me 😑
@dmtrmrv
@dmtrmrv 6 ай бұрын
Yeah! Those are logical properties. Very handy
Learn CSS display property in 4 minutes! 🧱
4:13
Bro Code
Рет қаралды 91 М.
Lamborghini vs Smoke 😱
00:38
Topper Guild
Рет қаралды 65 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 20 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Симбочка Пимпочка
Рет қаралды 4,8 МЛН
CSS gap is NOT a replacement for margins
10:20
Kevin Powell
Рет қаралды 38 М.
Master CSS Units: Pixels, REMs, & EMs
15:41
Dmitry Mayorov
Рет қаралды 1,2 М.
Learn CSS BEM (and avoid these common mistakes)
15:36
Dmitry Mayorov
Рет қаралды 8 М.
Programming with Math | The Lambda Calculus
21:48
Eyesomorphic
Рет қаралды 244 М.
Local RAG with IBM Granite and LlamaIndex🦙
17:00
Owain Kenway
Рет қаралды 130
Collapsing margins - what they are and how to deal with them
14:31
Kevin Powell
Рет қаралды 66 М.
Make Sense of Box-Sizing in CSS (and avoid this major mistake!)
13:59
10 CSS Pro Tips - Code this, NOT that!
9:39
Fireship
Рет қаралды 2,2 МЛН
Blueprints vs. C++: How They Fit Together and Why You Should Use Both
47:14
I tried React and it Ruined My Life
1:19:10
Tsoding Daily
Рет қаралды 154 М.