Тёмный

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

dcode
Подписаться 135 тыс.
Просмотров 71 тыс.
50% 1

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!

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 59   
@nikolaienger5459
@nikolaienger5459 Год назад
What is the shortcut he used at 1:40 ?
@ChristopherClaudioSkierka
@ChristopherClaudioSkierka Год назад
Big help thanks ps how did you copy the div multiple times, what key did you use etc? Thanks in advance
@houdamaarfi
@houdamaarfi Год назад
thank you so much
@shalomakeda3104
@shalomakeda3104 2 года назад
Thanks big help, hopefully you'd upload information on others tags to for easy reference to you. - beginner
@b-m0niz
@b-m0niz Год назад
ty so much!
@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
@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.
@qwertyuiopeleven
@qwertyuiopeleven 3 года назад
thanks! what color scheme is that?
@johnkirubainathan2554
@johnkirubainathan2554 3 года назад
how fast are you typing oh my god
@lacatuseduard2209
@lacatuseduard2209 3 года назад
will I get away if I use only classes?
@adamrobinson4375
@adamrobinson4375 3 года назад
Really helped me understand the difference as when I read about it, I didn't really understand. Cheers!
@quizkallie
@quizkallie 2 года назад
Thank you so much
@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 🙂
@verlouria
@verlouria Год назад
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.
@CommuniTradersLive
@CommuniTradersLive 4 года назад
Very helpful, thank you! Subbed =)
@dcode-software
@dcode-software 4 года назад
No probs! Cheers 😁
@LucianoClassicalGuitar
@LucianoClassicalGuitar 2 года назад
Jesus...2:05 It would take me like an hour to write that.
@hassanlearning4086
@hassanlearning4086 11 месяцев назад
The explanation was clear and easy to understand. The examples provided were also very helpful. Thank you.
@averydrago
@averydrago 4 года назад
got any resources for learning code? I am using w3schools and a little bit of khan academy right now
@lukeketterer
@lukeketterer 4 года назад
free-code-camp
@sukhreetkaur5722
@sukhreetkaur5722 3 года назад
Udemy
@yass1266
@yass1266 2 года назад
Very helpfull! I get the ID and Class more now related to Javascript. Thank you!
@tumanahwulukau2004
@tumanahwulukau2004 2 года назад
Suddenly it just became clear! Thank you !
@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
@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?.
@depelterturbo
@depelterturbo 2 года назад
Wow man it was so easy to understand. Thanks a lot.
@andromilk2634
@andromilk2634 Год назад
If you had the same title on different pages, I assume you could use the same ID also right?
@neramclasses-tamil9891
@neramclasses-tamil9891 3 года назад
I like the sound of the keyboard @2.03. katakatakata......
@alexanderrepollo1024
@alexanderrepollo1024 2 года назад
Thank you so much!, Finally I could understand th difference between them :D.
@NetherworldBibliotek
@NetherworldBibliotek 9 месяцев назад
THANK YOU! Finally, a simple explanation!
@gabes6899
@gabes6899 2 года назад
thanks
@zolbooenkhjargal2670
@zolbooenkhjargal2670 2 года назад
ok
@moza260
@moza260 4 года назад
3:37 its returning IDs vs Classes, not Title #2 is it because let function?
@yashtechconsulting
@yashtechconsulting 3 года назад
Great lesson, thanks
@jimsmith363
@jimsmith363 3 года назад
Thank you, the explanation was easy to understand.
@dcode-software
@dcode-software 3 года назад
Glad it was helpful!
@EnzoAuditore
@EnzoAuditore 2 года назад
Thanks mate, great video.
@lealdossantos2861
@lealdossantos2861 7 месяцев назад
Good explanation. Thanks
@DruideRC
@DruideRC 2 года назад
thank you
@dcode-software
@dcode-software 2 года назад
You're welcome!!
@jorgefrias7889
@jorgefrias7889 Год назад
Straight to the point. Sub!
@carsonbeerm.v3449
@carsonbeerm.v3449 3 года назад
Thank you so much :)
@natsukisubaru6929
@natsukisubaru6929 Год назад
Thank you mate.
@aryyann05
@aryyann05 3 года назад
2:03 u type so fast wowwwwww
@vihangajuly6316
@vihangajuly6316 4 года назад
thank you , sir
@MrIshumaru
@MrIshumaru 3 года назад
but why
@yamaikaguyachi
@yamaikaguyachi 2 года назад
Thank you! 😊
@dcode-software
@dcode-software 2 года назад
Any time!
@yamacode9958
@yamacode9958 6 лет назад
which playlist is this is?
@dcode-software
@dcode-software 6 лет назад
You can find this in the Web Development playlist on dcode
@thecubersahil6827
@thecubersahil6827 4 года назад
Thanks Man!
@dcode-software
@dcode-software 4 года назад
All good mate
@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 🙏🏻🙏🏻
@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.
Далее
When to Use CSS Classes vs Ids
16:07
Просмотров 11 тыс.
Why & When to Use Semantic HTML Elements over Divs
12:01
КОТЯТА В ОПАСНОСТИ?#cat
00:36
Просмотров 1,1 млн
荧光棒的最佳玩法UP+#short #angel #clown
00:18
Top 10 CSS One Liners That Will Blow Your Mind
13:34
Просмотров 961 тыс.
Whats the difference between IDs and Classes?
7:28
Просмотров 3,9 тыс.
Divs vs Spans
3:39
Просмотров 81 тыс.
Learn CSS Flexbox in 20 Minutes (Course)
20:37
Просмотров 132 тыс.