What is the difference between the CLASS and ID when you are
writting CSS?

Answer Posted / suji

ID uniquely identifies an element within a document where
CLASS attribute specifies an element to be a member of one
or more classes. Unlike with the ID attribute, any number of
elements can share the same class. CLASS attribute can be
used to impose a certain pattern in the webpage, like the
page's header, footer,etc. which will enhance uniformity
among all webpage of a website.

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is hr an empty tag?

601


What is formatting in html? Explain some formatting tags?

576


How do you keep list elements straight in an HTML file?

667


How to create scrollable tables in HTML-DHTML? My doubt is "I want to create a table whose header will remain stationery when I scroll the table vertically, but at the same time when I scroll horizontally, the header should scorll sidewise along with the body."

1951


What is local storage concept in HTML 5?

669


Which tag contains the cell tags?

643


What does the a tag stand for?

638


How do I keep people from stealing my source code and/or images?

607


Is html 5 backward compatible?

621


How to use output element? Give an example.

633


What is the difference between

and
tag?

621


What is h in html?

554


Why is html5 important?

630


What is html lang en?

592


What’s new HTML 5 DocType and Charset?

622