It is an important feature of CSS that it can be added by various ways in a webpage.
There are three ways of inserting a style sheet:
Use | Description |
---|---|
Inline CSS | Using the style attribute in the HTML start tag. |
Embedded CSS | Using the style Using the <style> tag within the code of the webpage. |
External CSS | Using the <link> tag to link an external CSS file in the webpage. |
Inline CSS is used to apply CSS directly on a single element
. It can apply the unique style by
putting the CSS directly into the start tag of a particular element. The style
attribute is used to give inline CSS.
This is a paragraph.
It is used when we want to give styling to the whole webpage at once.
It's scope is limited to the only webpage it is written in.
Although it can be written anywhere in the page within <style>
tag but is preferred within head section of html.
This is a paragraph of text.
In External CSS, the styling information is written in a separate CSS file which gets linked to a webpage by using <link>
tag.
A same CSS file can be added to many webpages to style the elements.
The <link>
element goes inside the <head>
section:
This is a paragraph.
List of color names supported by all browser »
List of character codes to display special character »
List of all language supported by all browser »
List of Country code supported by all browser »