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

How do you turn on html5 on safari?

531


Why to use method – lineto in canvas?

518


What is the advantage of using div tag in html web page development

480


How to redirect to new page on click of button in html?

473


Should nav be inside header?

507






How do you create multicolored text in a webpage?

533


What is emphasized text?

497


What is a

tag in html?

487


Does a hyperlink only apply to text?

556


Why to use xhtml.

541


What is dom in browser?

507


What is the purpose of Socket.bufferedAmount atribute of WebSocket?

554


What are Tags?

572


What are the new media-related elements in html5?

480


HTML 5 provides drag and drop facility. How do you make an image draggable?

549