ID tag - the ID tag enables designers to format a style to a single element . The " #" is used to specify and id element . However id tag is only used by one specific element which doesn't allow the formatting to be used to the full effect as it only applies to one element. This is why the class tag is argued to be seen as a formatting style which has more usability and more adaptable to changing the format of pages.
In the following example, the style rule matches the element that has the ID value "z98y". The rule will thus match for the P element:
<HEAD> <TITLE>Match P</TITLE> <STYLE > *#z98y { letter-spacing: 0.3em } </STYLE> </HEAD> <BODY> <P id=z98y>Wide text</P> </BODY>
<HEAD> <TITLE>Match P</TITLE> <STYLE > *#z98y { letter-spacing: 0.3em } </STYLE> </HEAD> <BODY> <P id=z98y>Wide text</P> </BODY>
Class tag - a class tag functions by a attaching an element to a named class. The name is given by whatever the designer feels is right , but unlike the ID tag it can be used to format many pages with same named class tag.
Tag selecor - this selector works by manipulating the behaviour of the element changing
its properties and allignments. The key difference between the tag selector and the ID is it doesnt need to be reffered to constantly.
Tag Selector
</head>
<body>
<p id="para1">Hello
World!</p>
<p id="yahya">Hello yahya how are you
today?</p>
<p id="para1">This paragraph is not affected by the
style.</p>
</body>
</html>
Advantage of inline
Tag selecor - this selector works by manipulating the behaviour of the element changing
its properties and allignments. The key difference between the tag selector and the ID is it doesnt need to be reffered to constantly.
Tag Selector
</head>
<body>
<p id="para1">Hello
World!</p>
<p id="yahya">Hello yahya how are you
today?</p>
<p id="para1">This paragraph is not affected by the
style.</p>
</body>
</html>
Advantage of inline