I finally understood! Thanks a lot! That 'clock-wise rotation' words immediately cleared out my all confusions!
@devondambrosio49784 жыл бұрын
You just made more sense in seven minutes than the last two hours of me studying in school. Thank you!
@septic73014 жыл бұрын
ikr
@tonyaanderson2 жыл бұрын
Same!!!
@EdmundAlynJones4 жыл бұрын
You're like the Bob Ross of Web Dev. Thank you for posting this.
@tonyaanderson2 жыл бұрын
This was the BEST explanation of margins and padding! THANK YOU!!
@emmamachi78222 жыл бұрын
i've watched countless tutorials on this only to feel more confused and losing the point. you have a talent for teaching. subscribed!
@rahuls38384 жыл бұрын
One of the best Tutorials out there! Thank you Steve for helping out millions of students across the globe.
@adelowokehinde582 жыл бұрын
I know it’s been years you posted this but you’re so calm, well explanatory and you makes a lot of senses.. thanks Steve 👏🏻
@ripcrypto51892 жыл бұрын
I love the fact you actually go straight to the point i know this was 1 year ago but this actually still helped me a LOT i was like “What the hell is margin and padding? But then i saw this thanks a lot ❤
@Moarmmoforme2 жыл бұрын
Short, concise and to the point. Much obliged kind sir!
@UriAlexandrovitz13 жыл бұрын
Excellent video! short yet very coherent
@khanayan-v7z2 жыл бұрын
Thank you so much steve, the way you explained was so simple and understandable!
@MikixIT4 жыл бұрын
Best Tutorial Ever, thank you so much
@shaoyangzhang79742 жыл бұрын
Really appreciate this lecture, you are the best👍😃
@shubhsagar62344 жыл бұрын
Now i an actually understanding css coz of you... Hope to complete whole playist thus week :)
@jiriorsag61842 жыл бұрын
Best tutorial, totally clear 👌 Thanks!
@OSmith3014 жыл бұрын
great explanation, thank you so much! Makes way more sense now
@Nitroco0l4 жыл бұрын
Wow brother, thank you I was having trouble understanding margins and padding. I feel more at ease now.
@chum24703 жыл бұрын
Your voice is so calming
@ElijahKabambala-jw8myАй бұрын
Thank you, well explained with much calmness
@MuhammadZubair-xw2pf3 жыл бұрын
Wow. Now i understand what is difference b/w them. Thanks
@sarthak13174 жыл бұрын
2:08 correction " 30 pixels "
@SteveGriffith-Prof3ssorSt3v34 жыл бұрын
Yes. Thanks. 40px would be the value if added. The actual will be 30px.
@newworld42522 жыл бұрын
Woww oh my God.i got the whole of it in minutes.. Thank you bro
@nagavenkateshkolapalli45474 жыл бұрын
Best lecture I have ever seen👍👍
@Iamgayathrinagarajan4 жыл бұрын
Just started learning..its so useful..Thank you
@haoql.76862 жыл бұрын
Very enjoyed watching this video while learning a lot as well
@tabrezpathan15882 жыл бұрын
Love the way you teach. It’s like a master class. Thank you for this. Ricky Bubbles Julian Randy! TPB is the best!
@espritcontemplatif79652 жыл бұрын
Uncountable thanks! Extremely Helpful.
@ogicacristian47993 жыл бұрын
Nice, very helpful and very easy to understand! Thank you very much!
@legitsports4808Ай бұрын
Use larger numbers so that people can clearly see the change happening.
@hussein3943 жыл бұрын
your sound prefect
@websurferwizard3 жыл бұрын
Hey steve, do you have a tutorial on how to set up Brackets? Just like you have it. I'm confused.
@SteveGriffith-Prof3ssorSt3v33 жыл бұрын
I switched over to VSCode in 2018 and haven't used Brackets since then. I highly recommend that all my students do the same. Emmet is built into VSCode. Here is a video about VSCode - kzbin.info/www/bejne/fKm1c52dicyomtk I did make this video about Brackets back in 2017 - kzbin.info/www/bejne/r5PPfmhsot1lg7c
@freemancity25183 жыл бұрын
Such a good explanation , it really helped me as visual learner.
@Hieucd973 жыл бұрын
Great video! What about negative values for margins and padding? Would it just go beyond the space? If I set my padding values to negative, would the words go outside of the blue box?
@SteveGriffith-Prof3ssorSt3v33 жыл бұрын
Negative padding doesn't work but negative margins will pull the box in different directions.
@Hieucd973 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Thank you! I'm new to HTML and was confused with margins and padding when I put in negative values
@hiroimitsuna73013 жыл бұрын
appreciate your work!
@96642911563 жыл бұрын
thank you sir for this video
@away65453 жыл бұрын
idc how old this video was. But it makes sense
@sunilchannelvlog37433 жыл бұрын
you deserve more mate, it was the best lecture i have ever had in my life, hitting sub
@lamokcm2093 жыл бұрын
i've been trying to get padding and margin for the last 2hours but this video made the understanding much easier in less than 5mn ! thanks a lot
@joemcdonough25103 жыл бұрын
paragraphs have a default margin on top and bottom of 1em. How come the background color does not have that 1em margin between each of the paragraphs? I wrote the same code out that you have at the beginning of this video in code pen and I see a margin between each of the three paragraphs.
@joemcdonough25103 жыл бұрын
what I mean is I see a small white gap between each of the paragraph's background colors. But at the beginning of your video, there is no small white gap between each of the cornflowerblue backgrounds. Does this make sense?
@SteveGriffith-Prof3ssorSt3v33 жыл бұрын
@@joemcdonough2510 margins always have a transparent background. Padding shows the background colour of the element.
@joemcdonough25103 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Thank you for answering. I'm still confused. Here is a link to the codepen I made: codepen.io/TromboneCode/pen/GRmWXmY The only way I can get the background-color of cornflowerblue to not be interrupted by the inherent margin on the top and bottom of paragraphs is if I put that background-color on the element itself. In your example it looks like you're putting the background-color on the elements. When I do it the way you have it written, there is an inherent margin of 1em between the top and bottom of each of the backgrounds due to the user-agent stylesheet.
@joemcdonough25103 жыл бұрын
Perhaps the external CSS stylesheet you're linking in has a background-color of cornflowerblue on ? but if that's the case, why would you explicitly add the same background-color to the elements in your internal CSS? Wouldn't that background-color display without needing to add it to the elements? I'm new to CSS so I really appreciate your video and your response.
@SteveGriffith-Prof3ssorSt3v33 жыл бұрын
@@joemcdonough2510 I had another attached stylesheet that removed the defaults. Defaults always cause unexpected confusion. I tend to use reset stylesheets when building sites because the defaults are different in different browsers. I teach my students to zero out all the padding and margin values and then only add them explicitly where they want them. That and to use box-sizing: border-box; *, *::before, *::after{ box-sizing: border-box; padding: 0; margin: 0; }
@kosaygobran3 жыл бұрын
woooow u made me understand it now
@sameerisonvacation3 жыл бұрын
Aww! Awesome 💗 thanks Man
@aneunjieroine31693 жыл бұрын
Thanks Sir it really helpful
@minercreepmc3 жыл бұрын
Why margin top/bottom do not get add to each other but left/right do, sir. Ex: If two of this top on each other .one{ margin-bottom: 20px} .two{margin-top:10px} So the margin between these will be 20px But if those sit next to each other .one{mg-right:10px} .two{mg-left:20px} Then margin between them will be 30px I read that margin top bottom will not be added, but left right they will. But I still a little bit confuse
@SteveGriffith-Prof3ssorSt3v33 жыл бұрын
Top and bottom margins collapse. They overlap and the larger value is used.
@krishnamohanyerrabilli40403 жыл бұрын
thanks for that dev
@deiraraj45473 жыл бұрын
Thanks for posting this.....It was very helpful... : )
@TheDQR3 жыл бұрын
You're great pal, great explanation, your very calmed voice made me put more attention, great video.
@zakhariihusar69753 жыл бұрын
Thanks. I"ve just begun and it helped me to adjust text in a list in a centre of the background picture!
@anthony.boyington3 жыл бұрын
Thank you so much! nice simple and well explained.
@TonyYakovenko3 жыл бұрын
Thank you, Steve! Short and to the point.
@benzflynn3 жыл бұрын
1. Don't forget defaults and inherits. Unless specified otherwise here www.w3schools.com/cssref/css_default_values.asp the default margin and padding will be zero. 2. Where an element has a default property value, e.g. has a default _padding-left: 40px;_ : here you must override it explicitly, e.g. _nav ul { padding: 0; }_ to establish it otherwise.
@SteveGriffith-Prof3ssorSt3v33 жыл бұрын
I do not trust anything from w3schools. They have been found to have erroneous information or be missing key items far too often. Yes, elements have default values. The default values are not always the same in all browsers. That is why there have been so many CSS reset and normalize stylesheets created. Many elements will have non-zero default values for padding and/or margin. I will typically add my own reset values for padding and margin to zero them out and then only add the specific values where and when I want them. However, this video is only about how margin and padding work as part of the box model not default values or best practices for CSS. I have another video on specificity - kzbin.info/www/bejne/gavChGeEoJmkr6s and another about the Cascade where I talk about inheritance - kzbin.info/www/bejne/hprKqYKvi6l8h8k
@damo1903 жыл бұрын
Do margin collapse happen in relatively positioned element? I didn't see such case. MDN only mentions margin collapsing won't happen in absolutely positioned element.
@SteveGriffith-Prof3ssorSt3v33 жыл бұрын
The margin collapse is applied only to the original space for the element. With relative positioning, the original space is saved, the element gets removed from the page while the rest of the page is built, and then put back in the original position with any translations with transform, top, left, etc.
@damo1903 жыл бұрын
Nice video Steve. I have difficulty in understanding the margin collapsing in nested block elements and with negative margin, I can't understand how the position of blocks change. Example, div{border:1px solid blue;} .container{background-color:yellow; margin:40px;} .box{background-color:orangered; margin:40px; } change margin When I added "margin-top: -50px;" to .box selector, I can't understand how two boxes position changes than before when I didn't change the margin. I checked without border too for margin collapsing, but couldn't understand. Please make a video on this topic.
@SteveGriffith-Prof3ssorSt3v33 жыл бұрын
Negative margins are actually quite rare. They used to be used a lot with float to create columns. Now people use flexbox and grid to accomplish this. Try this CSS to see if it makes more sense: .container { background-color: yellow; padding: 40px; margin: 40px; } .box { background-color: orangered; padding: 0; margin: -40px 40px 40px 40px; }
@YOUTUBE_IS_WOKE3 жыл бұрын
You should have put a colored box to enclose the content to show how the margins are applied and the padding as well. Just pointing your mouse in the area and telling the viewers "this is x margin blah" is difficult to assess.
@ranaasad50763 жыл бұрын
Hats off to you these 7 mins tells everything i want to know
@hafsahmr90103 жыл бұрын
Thank you so much!
@My-video1233 жыл бұрын
At last I understood! tnx
@janaschelle83773 жыл бұрын
Saving my life again and again... Thank you!
@mathmatikapret57123 жыл бұрын
Thank you very much bro
@smailsafire95933 жыл бұрын
This is the best explanation in the internet for margin and padding, thank you Steve for the lesson.
@bljelena903 жыл бұрын
This makes so much sense now thank you.
@Mammad12J3 жыл бұрын
Really good Tutorial. it was awesome.
@salehalnahdy87713 жыл бұрын
very much appreciated..thank you for your enlightenment :D
@nichoalaz62353 жыл бұрын
Hey thanks man! as someone whos only recently started learning HTML and CSS this video was really helpful.
@DSureshKumar3 жыл бұрын
Your voice is so brilliant.
@salehalnahdy87713 жыл бұрын
damn he sounds just like tom hanks
@DSureshKumar3 жыл бұрын
I subscribe your channel because you made this video very informative. Plz use this teaching skills in all your video. From my side you are 10/10.
@davidmp1703 жыл бұрын
Thanks a lot!
@argenisaguilar90453 жыл бұрын
Thanks so much
@abdullahamer92823 жыл бұрын
how can we move a text toward center left .I tried but didnt get it
@SteveGriffith-Prof3ssorSt3v33 жыл бұрын
kzbin.info/www/bejne/fH6vm2Bmq6yGqas kzbin.info/www/bejne/qX2kpqF_jZqFjtk These should help.
@shankarbaddi44244 жыл бұрын
Best explanation ever...
@harshalsurwase21854 жыл бұрын
i don't have left any confusion about padding and margin after watched this.
@sugabts32934 жыл бұрын
wow you shoud a teacher the way u explain things very smooth
@SteveGriffith-Prof3ssorSt3v34 жыл бұрын
I am a full-time professor. :)
@sugabts32934 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 lucky students
@SkeezerMui4 жыл бұрын
This tutorial was dope!! Thank you
@fahadibrahim72684 жыл бұрын
amazing explanation, opened a locked door for me as a beginner. Thank you
@soulofsong75184 жыл бұрын
you have amazing relaxing sound .
@soulofsong75184 жыл бұрын
thank you so much great video
@ahmedkafass97934 жыл бұрын
Thanks a lot 💚
@MobilTemp4 жыл бұрын
Great work
@ahmedel-hindawi92264 жыл бұрын
love your accent
@ycombinator7654 жыл бұрын
Awesome bro❤️❤️👍
@midkort4 жыл бұрын
Excellent explanation. Thank you!
@itchyaminoacid72514 жыл бұрын
crispy clear. thank you
@markzait27502 жыл бұрын
Very useful video. Thank you!
@ek5248 Жыл бұрын
It is pretty clear. Thanks
@madhumad13972 жыл бұрын
great... understood clearly. thanks!
@tanvirh77072 жыл бұрын
thank you, sir. that was really helpful
@thamodaran69984 жыл бұрын
Crisp and clear
@ridoanuddin33782 жыл бұрын
Thanks a lot. Appreciate it much, Brother.
@vivekhiremath18422 жыл бұрын
really helped me a lot
@elgunmhrrmov7672 Жыл бұрын
thank you so much for details
@weareeternal32302 жыл бұрын
Thanks! love your voice
@ersaix01803 жыл бұрын
no quetions only RESPECT. Thanks a lot
@master-ik9ro2 жыл бұрын
wow i think i understand frontend now haha!!! Thanks!!!
@elixr86024 жыл бұрын
Thanks Steve
@leonardmbibi80132 жыл бұрын
Great! Aptly put.
@IndianGaming02084 жыл бұрын
Best video 👍👌
@dilshankumarage64624 жыл бұрын
Thank you 👏
@boisauce11312 жыл бұрын
5:45 bars my dude
@saheedabdulsobur59812 жыл бұрын
Can you resize the image you are intending to use for the list-style image?? I will all appreciate your guidance. It gets bigger on my screen. Thanks
@SteveGriffith-Prof3ssorSt3v32 жыл бұрын
If you need to style the size of the image that you are using for your list bullets then you should use a background-image and scale it as you want with li::before{ }
@saheedabdulsobur59812 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 thanks so much steve
@armyteguh26495 жыл бұрын
really Love, nice, and what a great explanation... but sir, can i fill the value with %, rem, em, or we have to fill it with number only ?? and thanks in advance sir...