Class and ID Selector in HTML - Difference Between Class and ID Attribute in HTML - Class and ID Attribute in HTML - Class and ID Selector in CSS
Class and ID in HTML:
Difference Between Class and ID Attribute in HTML is that an id is used for identification of one element and class is used for identify more than one elements that are defined in the webpage.
When we define id for an element, To select that element with a specific id, we write a hash (#) character in the style that we use, followed by the id of that element. Thus, When we define class for an element, To select that element with a specific class, we write a dot (.) character in the style that we use, followed by the class of that element.
Let's take an example:
Short Code:
Output:
Looking Forward:
https://t.co/cF3TDd7Xku#classandid #classandidattributesinhtml #classandidincss #class #id #attributes #html #css #classattributeinhtml #idattributeinhtml #idandclass #idinhtml #classinhtml #classandidincssexample #htmlcoding
— EDUGYAN (@EDUGYAN1) May 30, 2020
For more details - Class and ID Selector in HTML | Difference Between Class and ID Attribute in HTML - Best Programming Videos on YouTube - EDUGYAN Channel
Thus, Class and ID Selector in HTML is that an id is used for identification of one element and class is used for identify more than one elements that are defined in the webpage.
0 Comments