How does applying CSS to an HTML document?
Answers
Use the HTML <style> element to define internal CSS.
Use the HTML <link> element to refer to an external CSS file.
Use the HTML <head> element to store <style> and <link> elements.
Use the CSS color property for text colors.
helps
Hi. CSS can be applied to HTML elements in 3 ways:
First Way: Using inline style using the style attribute like:
< h1 style="font-family:Arial; color:red; font-weight:bold" > Heading < /h1 >
Second Way: Using internal style using the < style > tag in the head section like:
< head > < style > h1{font-family:Arial; color:red; font-weight:bold} < /style > < /head >
< body > < h1 > Heading < /h1 > < /body >
Third Way: Using external style sheet. Just do the same body as in the second one and in the head tag, instead of the style tag, use the link tag like:
< link rel="stylesheet" href="location of style sheet" / >
And, in the style sheet, write:
h1{font-family:Arial; color:red; font-weight:bold}
Hope it helps!