What is the difference between id and class attributes?

Answers were Sorted based on User's Feedback



What is the difference between id and class attributes?..

Answer / nashiinformaticssolutions

• id: Unique identifier for an element. Can only be used once per page. Example: <div id="main">.
• class: Used to group multiple elements with similar styling or behavior. Example: <div class="container">.

Is This Answer Correct ?    0 Yes 0 No

What is the difference between id and class attributes?..

Answer / nashiinformaticssolutions

• id: Unique identifier for an element (used once per page).
• class: Used to define a group of elements with the same style or behavior.

Is This Answer Correct ?    0 Yes 0 No

What is the difference between id and class attributes?..

Answer / hr@tgksolutions.com

• id: Unique identifier for an element. Can only be used once per page. Example: <div id="main">.
• class: Used to group multiple elements with similar styling or behavior. Example: <div class="container">.

Is This Answer Correct ?    0 Yes 0 No

What is the difference between id and class attributes?..

Answer / hr@tgksolutions.com

• id: Unique identifier for an element (used once per page).
• class: Used to define a group of elements with the same style or behavior.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More HTML DHTML Interview Questions

What are the main features of html5?

0 Answers  


What is a bootstrap website?

0 Answers  


Is textarea an empty tag in html?

0 Answers  


What is transitional xhtml?

0 Answers  


What are navigation buttons?

0 Answers  


What is wrong with my <meta> tags?

0 Answers  


In how many ways you can display HTML elements?

1 Answers  


How do you create a meta title?

0 Answers  


What is the html tag for italicizing your text?

0 Answers  


How many spaces is a tab?

0 Answers  


What are features of HTML5?

0 Answers   NIIT,


What is a document tag?

0 Answers  


Categories