You are a Godsend to those learning how to code! I finally understand how margin and padding works in a deeper way. Thank you!! Subbed!
@KevinPowell5 жыл бұрын
Welcome aboard!
@Anon-te2bz6 жыл бұрын
What I've learned so far from this vid: So padding is creating space inside of a content, while margin is creating space outside of a content. You can also adjust specific spaces for both padding and margin, such as -left, -right, -top, -bottom, or you can all do it in one property. Lastly, using auto will take the biggest space as much as possible. You can also use auto to center objects. However, auto will be calculated as 0 when using it for -top and -bottom. Good video, thank you!
@KevinPowell6 жыл бұрын
You summed it up the entire video in a couple of sentences. I think I could have made this shorter, lol.
@hackzgamezyt4 жыл бұрын
Someone's taking notes!
@mdchowdhury38744 жыл бұрын
Your explanation was very clear. Though I've finished my course, I can say confidently that today, after watching this video, I've learned margin and padding and now, no more nervous about these two confusing things. Thanks, Kevin for your nice video.
@closetgrasshopper26276 жыл бұрын
Your explanation is so clear and concise. I feel like 90% of programming tuts videos here are some Indian guy or some computer science nerd who have no social skills, trying to explain things but end up just rambling. Thank you for this. VERY MUCH
@KevinPowell6 жыл бұрын
You're very welcome Closet Grasshopper! Really glad that you like the video and how I present my stuff :)
@rootuser56523 жыл бұрын
@shashanka Mg pretty sure she was referring to the “computer science nerd” as the one with no social skills.
@wholeness5 жыл бұрын
Just for the observer, you never actually answered the question when to use one versus the other. Great tutorial though.
@KevinPowell5 жыл бұрын
It's not always so simple, but I like to look at it as padding for more background, margin for extra space.
@abdulrehman51592 жыл бұрын
Now I understood completely! Thanks for the detailed video on the topic.
@pratikbhandari66794 жыл бұрын
On the thumbnail I think its "basics" not "bascis" 🤣🤣🤣
@NeroIvanY6 жыл бұрын
Thanks for your work, Kevin. Very clear explanation. Looking forward to the third video! very interested in your thoughts about real life cases!
@KevinPowell6 жыл бұрын
Thanks Ivan, glad you liked it. And that video will be out Friday, so not too long to wait 👍
@MesutAkcan4 жыл бұрын
the very BASCiS !!! ???
@adarshsoni53236 жыл бұрын
Hi Kevin please make video series on JavaScript from beginners to expert level .....please
@KevinPowell6 жыл бұрын
I'll be making and using JavaScript more, but I think a whole series would kill me, haha. There is just sooooo much to cover.
@RamonMartinez-jz9uv6 жыл бұрын
Great job Kevin, very clear video. A couple questions seem to arise though...does it seem strange that css defaults div boxes to the upper left hand corner? Like why wouldn't it default to any other alignment, say centered, or to the upper right corner, or lower left corner? Is that just per the spec--and if so where can we view the spec details themselves? My initial guess was CSS mimics the left to right nature of western languages, but then why does CSS stack the boxes in a column and not in a row, again as western languages do? Any thoughts are greatly appreciated.
@KevinPowell6 жыл бұрын
Divs are block-level elements. Any block level element automatically starts a new line of content and takes up the full width of its parent (by default). This is also why it stacks things, because block-level elements automatically start a new line of content, whereas inline and inline-block elements do not. A div behaves the same way as a paragraph, they are both block-level. If paragraphs created columns instead of new rows of content, that would be a pain! If we give it a set width, then yes, it's on the left side. It starts at the top because, well, I'm not 100% sure where in the specifications it talks about that, but if it didn't it would be hard to build a website (from bottom to top???). I could be wrong, but starting from the top makes it a lot easier than anything else, that way our content follows the flow of the HTML we're writing. As far as it being on the left, if we give it a width, yes, it's on the top left. However, like you said, if you set your site up for a right-to-left language, it would go to the top right, instead of top left (you can read more on that here: www.w3.org/International/questions/qa-html-dir ). This, I think, makes a lot of sense. As far as the documentation, w3.org is where all of it would be, in relation to the standards, though I often find that the MDN is much more user-friendly as it includes examples and browser support tables, as also links to both the existing standard, as well as working drafts for future implimentations - developer.mozilla.org/en-US/
@NeoKarthik4 жыл бұрын
I finally get he margin: auto statement. Thank you so much!
@acidhauss70183 жыл бұрын
I am a full stack developer bodge together website and i have no fing clue what im doing with css but your videos help me a lot thank you
@tbgan66756 жыл бұрын
Thumbs up for every series. Helping many of us especially those who just beginner
@KevinPowell6 жыл бұрын
Thanks a lot, and I'm happy to help 😁
@sbtoolman121232 жыл бұрын
This is going to seem like a stupid question, (and more than likely is). But, if you set for values for the margin ( say 100 50 100 50 and it sets these in a clockwise fashion, you then erase the last one so it is now 100 50 100, why would css use the 50 value instead of just using the default (since there is no value assigned to it)? Yes i am VERY new to all of this. (HTML, CSS...all of it.)
@Hannibalism3 жыл бұрын
Ah, finally someone that gives it loud and clear with no confusing metaphors.
@ginasta75753 жыл бұрын
Exactly! Sometimes I prefer watching the indian tutorials because they get straight to the point (even though I don't speak Hindi I somehow learn visually)
@sebastiandelima73854 жыл бұрын
Thank you so much for taking the time to explain these concepts, you can tell that you put a lot of good intention and consideration on this video, it's a total like for me.
@moritz5844 жыл бұрын
great vid!
@chma03 жыл бұрын
Hi , can you help me with a website i build I have a problem with show more bottom and the position of the bottom. If u will I'll show you the code and pic for the problems please help me
@niraj2216 Жыл бұрын
Beautifully Explained. Thank You.
@adhityapoernama9406 жыл бұрын
A very straight and clear explanation video! thank you!
@KevinPowell6 жыл бұрын
Thanks, glad that you liked it!
@william35882 жыл бұрын
Margin does not affect element width, its just border and padding, no?
@Tesla-Live____4 жыл бұрын
thanks the tutorial was so helpful
@lifeofdidrik11 ай бұрын
Please correct me if i am wrong Margin creates space outside the element with the content on the inside and padding creates space on the inside?
@vanessakimana39292 жыл бұрын
Thanks Kevin for clarifying this 👏🏽
@rio25723 жыл бұрын
thought this was about stocks.. i was eating then was sooooo confused when he started coding lmao oops wrong video
@amitpandhare26632 жыл бұрын
my mam used to say, "never trust a man who does a spelling mistake in a thumbnail"
@sknEK_code_chef Жыл бұрын
very helpful. but the image is "the very bascis" :)
@drummerdev55226 жыл бұрын
Great series on margins and padding. One thing that may help new learners with the margin auto centering method is making sure they know the containing div's width. I can't count how many times I tried to use the margin auto method and wanted to shake my computer, because I nested or the parent width was not 100% of the screen size. I also enjoyed seeing the BEM naming convention in the third video. It seems to be the current favorite of the industry and it is something I myself am currently trying to get into the habit of using. :)
@KevinPowell6 жыл бұрын
Oh man, I totally should have mentioned giving it a width for that to work, totally missed the mark on that. Thanks for mentioning it though, I'll add it in the description of the video. I always liked the concept of BEM, but the whole double underscore thing sort of annoyed me, but the more complicated projects you work on, you start to see the benefit of it all. I'm happy I'm playing around with it now, and I think it's won me over at this point.
@TheDJDannyJ3 жыл бұрын
it works very, exactly, much the same... hahahah, oookay.
@JonFuller10046 жыл бұрын
One thing I have bumped into recently was padding and or margin was causing my elements to break out of the container when using grid. Not quite sure why they wanted to do that. I thought with grid. If the size of he object or the margin or padding got to wide it would auto go on to next column. Maybe I was mucking something up
@KevinPowell6 жыл бұрын
Nah, things will overflow outside of their cell if they are bigger than the cell. By default, something will be taking up one row and one column, it won't automatically assume that it should actually take up two. That *could* be a cool behaviour, but I could also see it causing some problems.
@amirani8363 жыл бұрын
your video's, maks me feel, that I have progess
@sheeshee63513 жыл бұрын
The thumbnail says Bascis. Is it intentional or no one noticed in 3 years ?
@jashanpreet8803 жыл бұрын
welll done sir i was struggling with this property
@omphemetsemafoko830 Жыл бұрын
Thank you for the clear explanation.
@PswACC3 жыл бұрын
Your thumnail for this video has a Typo
@kevincrum2375 Жыл бұрын
ive been curious about how gap also fits into this
@abouhashim1003 жыл бұрын
first time to know the difference... thanks
@tanushs084 жыл бұрын
10:50 margin top : auto = 0 margin bottom : auto = 0
@robertrydlewski95385 жыл бұрын
Kevin ... Your the best, period. Thanks a lot
@driziiD3 жыл бұрын
damn, i wanmted you to explain border
@psyrotix24636 жыл бұрын
"Deep Dive: The Basics" LOL
@KevinPowell6 жыл бұрын
Gotta start somewhere with the deep dive 😁
@psyrotix24636 жыл бұрын
No I was just laughing at the oxymoron, great video though!
@_ata_32 жыл бұрын
Thank you. Do you recommend using background or background-color when setting a colored background?
@cow2404 жыл бұрын
very useful, thanks! However you mentioned margin-left and margin-right 0 will centre it across the screen at the 12.03 minute mark. Is that right?
@arvindk48134 жыл бұрын
I was looking for this , yeah this is it thank you.
@space_monkey1256 жыл бұрын
Hi kevin, thanks for the awesome videos. It helps me alot. :)
@KevinPowell6 жыл бұрын
Glad to hear that Ameen!
@tochiojukwu26142 жыл бұрын
So i can use margin to change the position right?
@namekomuna11292 жыл бұрын
Yeah I got this. Choose according to your need. If you are done with margin, stick with it. If padding can do it, use padding.
@everlastproducciones92804 жыл бұрын
Thanks for your time
@SM-ok3sz3 жыл бұрын
Your title card is misspelled
@JLDReactions3 жыл бұрын
Great explanation.
@webb-developer Жыл бұрын
perfectly explained ✅
@BishalDas-xu4zi3 жыл бұрын
A thanks from an Indian ❤️
@maran.ath42 жыл бұрын
he literally took oversimplification to another level, I wish all my teachers were like you🥲thanks a bunchhh
@iboro-kun844 жыл бұрын
No, thank you, Mr Powell. You're awesome, not a little bit.🤝
@anyzzas71496 жыл бұрын
Thanks for the good tutorial.
@learntocode18785 жыл бұрын
Hi Kevin, thank you for this video brother. I subscribed. Your videos are the best. Can you please show how to create a one page scroll
@eileenmfox42662 жыл бұрын
I don't see a link to the codepen.
@muratg93952 жыл бұрын
Thank you Kevin.
@AmanSharma-bv4ii2 жыл бұрын
thank you uncle 🙏🏼
@krishnamohanyerrabilli40403 жыл бұрын
Thanks for that Sir.
@damion58745 жыл бұрын
Thanks for the teaching. Looks like the thumb nail for this video has a misspelling.
@ninjaaljun76742 жыл бұрын
.
@network_noob2 жыл бұрын
@pauljohn38983 жыл бұрын
Feel lucky to know you from the very beginning I learn CSS
@elhamzeinodini48283 жыл бұрын
💥🌹
@BUDX4 жыл бұрын
Thank you very much for explaining this. I was really struggling with this but now it's all clear.
@tristanmckellen99724 жыл бұрын
thank you so much!
@dhanushsivajaya13564 жыл бұрын
Thankyou sir
@ericdy21183 жыл бұрын
thanks so much!
@gaetanoalessandro2864 жыл бұрын
Hi, thanks a lot for sharing your knowledge: you 're helping me!! :-)
@ingridhernandez27824 жыл бұрын
I appreciate your videos so much. Thank you
@yadusolparterre3 жыл бұрын
Excellent tutorial, there are so many tutos here but this one goes deeper and I finally got it after many years of confusion
@olenasid83 жыл бұрын
Thank you!
@alvarocarrilho5 жыл бұрын
Thks From Lisbon - Portugal
@justaguywholikeshentai90193 жыл бұрын
KING OF CSS!
@dynamic-homepages2 жыл бұрын
Thanks =)
@ycombinator7653 жыл бұрын
B A S C I S
@shivarammuthukumaraswamy71644 жыл бұрын
loved the explanation..tysm buddy..
@Brospeh004 жыл бұрын
Very informative, thanks Kevin!
@rahuldora15874 жыл бұрын
Awesome explanation love It ❤️
@marcusmorrow39004 жыл бұрын
Good stuff. Well explained
@mohammadakramsheik16575 жыл бұрын
Best video, thank u very much
@karolinalencina71213 жыл бұрын
thank you so much!!!
@calvinebun-amu53974 жыл бұрын
Great video, Kevin.
@mahdi35214 жыл бұрын
man can't thank u enough legend
@benjirification6 жыл бұрын
I just loved this series and the way you explained it easily.Looking forward to watch next :)
@KevinPowell6 жыл бұрын
Thanks Benjir, glad you liked it :)
@js_programmer84235 жыл бұрын
so padding is basically height & width in an alternative way
@KevinPowell5 жыл бұрын
A more dynamic way, yes :) - will adjust to your content, which is nice.
@KradianKrad4 жыл бұрын
Best explanation!
@brogen1005 жыл бұрын
mind blown! I nominate you teacher of the year
@KevinPowell5 жыл бұрын
Thanks so much 😊
@bloc-notes67515 жыл бұрын
You are the best !
@paketa77364 жыл бұрын
You are a great teacher. Thank you, teacher!
@baljeetgulati46054 жыл бұрын
hats off to u sir!
@shrookwageh59765 жыл бұрын
what to say. you're so awesome
@vampirekabir6 жыл бұрын
man!you explain like a bosss!!
@KevinPowell6 жыл бұрын
Thanks! Super glad you liked it!
@willl00146 жыл бұрын
Black deep!!
@happyhuman85496 жыл бұрын
pls make a video about borders!!
@KevinPowell6 жыл бұрын
What do you want to know about borders? I generally don't do much with them, so I'm curious :)