CSS how to use in HTML
Three Ways to Insert CSS
- External style sheet
- Internal style sheet
- Inline style sheet
External style sheet
With an external style sheet, you can change the look of an entire website by changing just one file!
external style sheet file inside the <link> element. The <link> element goes inside the <head> section:
Example
<link rel="stylesheet" type="text/css" href="mystyle.css">
Internal Style Sheet
An internal style sheet may be used if one single page has a unique style.
Internal styles are defined within the <style> element, inside the <head> section of an HTML page:
Example
<head>
<style>
</style>
</head>
</head>
Inline Style Sheet
An inline style may be used to apply a unique style for a single element.
To use inline styles, add the style attribute to the relevant element.
Example
<h1 style="color:blue;margin-left:30px;">This is a heading.</h1>
Comments
Post a Comment