No video

What's the difference between IDs & Classes? | HTML, CSS & JavaScript

  Рет қаралды 69,141

dcode

dcode

Күн бұрын

When developing a website or web application, it's important to keep in mind the difference between an ID and a Class, and to know when to use each one and why.
The primary thing to remember about this is that you should be using an ID for a unique element that only exists once on the document whereas classes are more appropriate for multiple elements that serve the same purpose.
In this video I take you through this topic and how it affects not only your HTML markup but also your CSS code and JavaScript.
For your reference, check this out:
css-tricks.com...
Support me on Patreon:
/ dcode
Follow me on Twitter @dcode!
If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

Пікірлер: 59
@verlouria
@verlouria 11 ай бұрын
Ty I'm doing one of these 5d boot camps to see if coding is something I want to pursue or if my brain can handle it.... and I got hung up on the difference of class and id selectors but you explained it really well. It was a lot easier than I was making it out to be.
@adamrobinson4375
@adamrobinson4375 3 жыл бұрын
Really helped me understand the difference as when I read about it, I didn't really understand. Cheers!
@hassanlearning4086
@hassanlearning4086 9 ай бұрын
The explanation was clear and easy to understand. The examples provided were also very helpful. Thank you.
@jetskeeter69
@jetskeeter69 2 жыл бұрын
Wow, that makes it all clear now. Now I know I shouldn't be abusing the ID when I work with javascript and the fact that I have should know that ID needs to be unique or that it cannot use its name multiple times. Reading about it confuses me when I only work with html and css as I can use id name multiple times.
@tumanahwulukau2004
@tumanahwulukau2004 2 жыл бұрын
Suddenly it just became clear! Thank you !
@tinymangos46
@tinymangos46 2 жыл бұрын
Lol, this is the best explanation i found,, althought i've been 3 years into web development i still search for this XD
@dcode-software
@dcode-software 2 жыл бұрын
Awesome 🙂
@NetherworldBibliotek
@NetherworldBibliotek 8 ай бұрын
THANK YOU! Finally, a simple explanation!
@yass1266
@yass1266 2 жыл бұрын
Very helpfull! I get the ID and Class more now related to Javascript. Thank you!
@quizkallie
@quizkallie 2 жыл бұрын
Thank you so much
@depelterturbo
@depelterturbo 2 жыл бұрын
Wow man it was so easy to understand. Thanks a lot.
@lealdossantos2861
@lealdossantos2861 6 ай бұрын
Good explanation. Thanks
@yashtechconsulting
@yashtechconsulting 3 жыл бұрын
Great lesson, thanks
@houdamaarfi
@houdamaarfi Жыл бұрын
thank you so much
@CommuniTradersLive
@CommuniTradersLive 4 жыл бұрын
Very helpful, thank you! Subbed =)
@dcode-software
@dcode-software 4 жыл бұрын
No probs! Cheers 😁
@jimsmith363
@jimsmith363 3 жыл бұрын
Thank you, the explanation was easy to understand.
@dcode-software
@dcode-software 3 жыл бұрын
Glad it was helpful!
@b-m0niz
@b-m0niz 11 ай бұрын
ty so much!
@nikolaienger5459
@nikolaienger5459 Жыл бұрын
What is the shortcut he used at 1:40 ?
@gabes6899
@gabes6899 2 жыл бұрын
thanks
@EnzoAuditore
@EnzoAuditore 2 жыл бұрын
Thanks mate, great video.
@natsukisubaru6929
@natsukisubaru6929 Жыл бұрын
Thank you mate.
@DruideRC
@DruideRC 2 жыл бұрын
thank you
@dcode-software
@dcode-software 2 жыл бұрын
You're welcome!!
@alexanderrepollo1024
@alexanderrepollo1024 2 жыл бұрын
Thank you so much!, Finally I could understand th difference between them :D.
@jorgefrias7889
@jorgefrias7889 Жыл бұрын
Straight to the point. Sub!
@randomguy6832
@randomguy6832 3 жыл бұрын
i used same id for 3 images in a div element and it worked for all 3 elements why?
@maheephoenix4398
@maheephoenix4398 2 жыл бұрын
You could have given that id to the div instead of giving it to imgs separately.
@ChristopherClaudioSkierka
@ChristopherClaudioSkierka Жыл бұрын
Big help thanks ps how did you copy the div multiple times, what key did you use etc? Thanks in advance
@yamaikaguyachi
@yamaikaguyachi 2 жыл бұрын
Thank you! 😊
@dcode-software
@dcode-software 2 жыл бұрын
Any time!
@shalomakeda3104
@shalomakeda3104 2 жыл бұрын
Thanks big help, hopefully you'd upload information on others tags to for easy reference to you. - beginner
@carsonbeerm.v3449
@carsonbeerm.v3449 3 жыл бұрын
Thank you so much :)
@AliSiHosseini
@AliSiHosseini Жыл бұрын
Thank you a lot you for sharing such an important point. I am a bit confused about something that I notice in this tutorial, which is the color of the why is not black and you didn't even style it yet ??. can you make it clear for me how you had the in the body part with this colour?.
@vihangajuly6316
@vihangajuly6316 4 жыл бұрын
thank you , sir
@thecubersahil6827
@thecubersahil6827 4 жыл бұрын
Thanks Man!
@dcode-software
@dcode-software 4 жыл бұрын
All good mate
@roadmanrecords7644
@roadmanrecords7644 2 жыл бұрын
sometimes css don't recognize my class when I have to style it ? How can that be. Examble When I type .logo{} nothing registers. Especially when I have to style multiple
@andromilk2634
@andromilk2634 Жыл бұрын
If you had the same title on different pages, I assume you could use the same ID also right?
@AtTheEnd1000
@AtTheEnd1000 3 жыл бұрын
In a video I watched, the narator said that the ids are used less and less and that classes are becoming more used, just because you can target multiple elements. Is this true in the industry?
@pendek3255
@pendek3255 3 жыл бұрын
id can be used one time, class everytime everywhere you want, so yes you are right
@moza260
@moza260 4 жыл бұрын
3:37 its returning IDs vs Classes, not Title #2 is it because let function?
@averydrago
@averydrago 4 жыл бұрын
got any resources for learning code? I am using w3schools and a little bit of khan academy right now
@lukeketterer
@lukeketterer 3 жыл бұрын
free-code-camp
@sukhreetkaur5722
@sukhreetkaur5722 3 жыл бұрын
Udemy
@johnkirubainathan2554
@johnkirubainathan2554 3 жыл бұрын
how fast are you typing oh my god
@LucianoClassicalGuitar
@LucianoClassicalGuitar 2 жыл бұрын
Jesus...2:05 It would take me like an hour to write that.
@neramclasses-tamil9891
@neramclasses-tamil9891 3 жыл бұрын
I like the sound of the keyboard @2.03. katakatakata......
@qwertyuiopeleven
@qwertyuiopeleven 3 жыл бұрын
thanks! what color scheme is that?
@lacatuseduard2209
@lacatuseduard2209 3 жыл бұрын
will I get away if I use only classes?
@aryyann05
@aryyann05 3 жыл бұрын
2:03 u type so fast wowwwwww
@zolbooenkhjargal2670
@zolbooenkhjargal2670 Жыл бұрын
ok
@yamacode9958
@yamacode9958 6 жыл бұрын
which playlist is this is?
@dcode-software
@dcode-software 6 жыл бұрын
You can find this in the Web Development playlist on dcode
@MrIshumaru
@MrIshumaru 3 жыл бұрын
but why
@illuminati7294
@illuminati7294 4 жыл бұрын
what font are you using man? It's very nice.
@dcode-software
@dcode-software 4 жыл бұрын
The font is Roboto Mono
@illuminati7294
@illuminati7294 4 жыл бұрын
dcode thank you man 🙏🏻🙏🏻
When to Use CSS Classes vs Ids
16:07
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 11 М.
Why & When to Use Semantic HTML Elements over Divs
12:01
ByteGrad
Рет қаралды 92 М.
Parenting hacks and gadgets against mosquitoes 🦟👶
00:21
Let's GLOW!
Рет қаралды 13 МЛН
Kind Waiter's Gesture to Homeless Boy #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 14 МЛН
小丑把天使丢游泳池里#short #angel #clown
00:15
Super Beauty team
Рет қаралды 45 МЛН
Divs vs Spans
3:39
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 81 М.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 943 М.
Whats the difference between IDs and Classes?
7:28
A Designer Who Codes
Рет қаралды 3,7 М.
These CSS PRO Tips & Tricks Will Blow Your Mind!
8:48
Coding2GO
Рет қаралды 248 М.
Tech 101: Understanding CSS Classes vs. IDs
4:58
Skillcrush
Рет қаралды 597
10 CSS Pro Tips - Code this, NOT that!
9:39
Fireship
Рет қаралды 2,2 МЛН
CSS Tutorial - Selectors, Element, Class and ID (3/13)
6:35
ColorCode
Рет қаралды 49 М.
CSS Tips And Tricks I Wish I Knew Before
12:12
Lama Dev
Рет қаралды 468 М.
Parenting hacks and gadgets against mosquitoes 🦟👶
00:21
Let's GLOW!
Рет қаралды 13 МЛН