What are Tag Selectors
By using Tag Selectors we can define styling for existing HTML tags Often used to set the basic styles that will appear throughout a Web site
How Tag Selectors are used
HTML Selector {Property:Value;}
Eg : b {font-family:Arial, Helvetica, sans-serif; font-size:14px; color: red;}
This means Arial font of size 14 and red in color is stored within the tag b.
CSS with HTML tag selector, example:
body {
font-family: Arial;
font-size: 14px;
color: red;
text-align: left;
}
The meaning of the CSS code above is: every text inside the body tag will be appeared in Arial
font face with size 14 px, red color and left alignment. As the tag selector is defined within the
body tag only the text appearing in the body will change. However the paragraph text, header
text and others will remain unaffected.
0 comments:
Post a Comment