ID is used to uniquely identify an element(a unique identifier). It is particularly useful when you want only 1 element to have specific styling. Another use is in JavaScript. JS uses getElementbyID to call upon an element to perform specific tasks. Class is used to define styling for HTML elements. It can be used multiple times, meaning that multiple elements can use the same class to style.
Bro Code
Box 1
Box 2
/* style.css */
body{
margin: 0px;
}
.box{
border: 5px solid;
font-size: 5em;
width: 250px;
height: 250px;
margin-top: 50px;
margin-right: 50px;
margin-bottom: 50px;
margin-left: 50px;
}
#box1{
background-color: hsl(0, 100%, 60%);
}
#box2{
background-color: hsl(189, 100%, 55%);
}
bro is a legend
M9wed had sat, kayshr7 khir men les profs
@@samisado6331 check point l m4arba li 4aydozo hna
Bro visited his friend
@@ElysiumGresit lol
@@imrane206 margin w padding w font-size w lakhra nsitha ba9i mafhmtch logique fihom
Wow you help me alot understanding stuff about html and css. Thanks alot!
Really helpful for understanding margin concept
it's clear and easy to understand the usage.
Nice Video. margin-left: auto; with margin-right: auto; is also a good combination.
I like the way you have expalined I am starting to learn it, thanks for your short and clear explanation.
love your sharing. Short & easy to understand
Thanks man your videos have really helped me to master css. Sincerely you are best youtuber when it comes to explaining any code related stuff.
Thank You So Much!!!! This Is So UseFull For Us!!!!
video của bạn rất hay
Great thank you
Genius of the Century
Love you Bro I missed you too much😭🤧
THIS IS GOOD
thanks bro, it helped me
Thank you soo much
ty brother
Couldn't have said enough thank you
Can you please explain the margin: inherent
Why do you use class and id within the same div again?
Was that a Shrek reference? 😉
Hello I just want to ask. what is the difference of class and id? thank youu
I think we use id to track / find element with java script like (get element by id)
There isn't really a difference
I think class can be used for multiple stuff at the same time but ID not? Im not sure
ID is used to uniquely identify an element(a unique identifier). It is particularly useful when you want only 1 element to have specific styling.
Another use is in JavaScript. JS uses getElementbyID to call upon an element to perform specific tasks.
Class is used to define styling for HTML elements. It can be used multiple times, meaning that multiple elements can use the same class to style.
@@TheRetiredBatman Your're right.