How to use Classes and IDs in HTML5 and CSS3 | Introduction to HTML5 and CSS3 | HTML5 and CSS3
Want to learn HTML5 and CSS3 from scratch?
This is the ninth episode of my “Learn HTML5 and CSS3” course. In this course, we will learn everything about how we can create markup for a website. At the end of the course, I will add some full tutorials where I will be creating famous websites from scratch. So, if you have any suggestions, just let me know and I might make a video about it!
In this video, I want to talk about a very important subject. I want to show you what classes and IDs are, how to use them, and when to use them.
1. Classes
I recommend you to use classes when you want to consistently style multiple elements throughout the page. Classes are useful when you have more than one element that share the same style.
2. IDs
Use the ID attribute when you have a single element on the page that will take the style because an ID is unique. IDs are unique identifiers, which means Each element can have only one ID, so you cannot add another attribute id with a different name.
My official websites for questions or anything else:
https://www.darynazar.com
Follow me on social media
https://www.instagram.com/darynazar/
https://www.linkedin.com/in/dary-nazar-61502ab2/
Useful products for programming and recording that I use
Microphone I use:
https://amzn.to/39r7qVD
My laptop stand:
https://amzn.to/32PULcn
External monitor:
https://amzn.to/2wzxPSl
Reading LED Desk lamp:
https://amzn.to/2PNMoJ5
External Hard Drive to save projects:
https://amzn.to/2TEjWdI
Laptop I use:
https://amzn.to/3aspOxp