What is the use of DIV tag in HTML - Difference between ID and Class Selector in HTML


What is the use of DIV tag in HTML - Difference between ID and Class Selector in HTML

DIV tag is used to make a section or a block on web page. It is the very frequently used tag for designing websites and templates.It is access in CSS by providing selectors ID and Class or both. 

ID can be access in CSS by using (#) symbol and class is access in CSS by using (.) symbol.

Difference between ID and Class:-
                                                      ID is used to give a unique identity to a tag and Class can be multiple for a tag.

Example:-
<html>
<style type="text/css">
div
{
      background:red;
      color:blue;
}
<body>
<div>this is the DIV </div>
</html>


{ 0 comments... read them below or add one }

Post a Comment