CSS is used in HTML to change elements styles like color, size, fonts etc. CSS is inserted in three ways within HTML page.
External CSS is inserted in HTML page by using <link> element. The benifit of using external CSS is it separate HTML form CSS and makes code easy to understand and you can apply same css file to multiple pages.
<link rel=stylesheet
type=text/css
href=css file
/>
You can insert any number of stylesheets using link element.
You can give any name to css file but do not forget to give .css
extension after css file name
Internal CSS is inserted in HTML page by using <style> element, if your web page has different styles or you have wanrt to apply styles to single page then internal CSS is good.
<style>
CSS styles
</style>
You can use any number of stylesheets using link and style elements.
You can give any name to css file but do not forget to give .css
extension after css file name
Inline CSS is used within a single element by using <style> element in inline
<tag style=CSS styles
>content</tag>
You can apply inline css to any element but single element have only single inline css.
You can give any name to css file but do not forget to give .css
extension after css file name
Open notepad or any other text editor, follow the following points.
internal-css
save file with name task.html or task.htm and then open it using any browser and see results.
Don't forget that you can use multiple stylesheets in single HTML page.