The id selector is used to specify a style for a single, unique element. The id selector uses the id attribute of the HTML element, and is defined with a "#". class: The class selector is used to specify a style for a group of elements.
The id selector is used to specify a style for a single, unique element. The id selector uses the id attribute of the HTML element, and is defined with a "#".
class: The class selector is used to specify a style for a group of elements.
id: Each element can have only one ID and each page can have only one element with that ID. While with class: You can use the same class on multiple elements and multiple classes on the same element.
id: Each element can have only one ID and each page can have only one element with that ID. While with class: You can use the same class on multiple elements and multiple classes on the same element.
The id selector is used to specify a style for a single, unique element.The id selector uses the id attribute of the HTML element, and is defined with a "#".
The class selector is used to specify a style for a group of elements. Unlike the id selector, the class selector is most often used on several elements.The class selector uses the HTML class attribute, and is defined with a "."
id or class both are different because id is use only single time it is use in html documents or class is use many time in html document only when css is use or when we give layout to the html document .
id and classes both are use in htmnl web pages. but work of both if different id is use only one but class is use many time in the html when css is used.