CSS tag selector
Notes:
CSS tag selector demo:
Tag selector:
To select tags by their name and apply styles on them we use tag selector.
Syntax of CSS rule-set / rule:
selector
{
declaration list;
}
To implement tag selector, In place of selector, we write tag name.
Syntax of tag selector:
tagname
{
declaration list;
}
It selects every html tag with the specified tag name and applies styles on them.
Example for tag selector:
p
{
color: green;
font-size:16pt;
border: 2px solid red;
}
It selects every p tag available on the page and applies specified styles on them.
Interview Questions: