Types of CSS
There are three different methods to add CSS styles to the HTML document. These are:
1. Inline CSS:
Inline CSS is a method of styling where CSS properties are directly applied to HTML elements within the body section using the style attribute.
<h1 style="color: green;">w3wiki</h1>
2. Internal CSS:
Internal CSS is used when a single HTML document must be styled uniquely. The CSS rule set is embedded within the HTML file in the head section using the <style> tag.
<!DOCTYPE html>
<html>
<head>
<title>Internal CSS</title>
<style>
h1 {
color: green;
}
</style>
</head>
<body>
<h1>w3wiki</h1>
</body>
</html>
3. External CSS:
External CSS involves creating a separate CSS file that contains only style properties. This file is linked to the HTML document using the <link> tag.
/* This will be separate file, for example style.css */
<style>
h1 {
color: green;
}
</style>
CSS Full Form
The full form of CSS is Cascading Style Sheets. It is a style sheet language used to add styles to HTML documents displayed in browsers. CSS enhances the user experience by making web pages more attractive and user-friendly. Developed by the World Wide Web Consortium (W3C) in 1996, CSS can be applied to HTML documents in various ways.
Table of Content
- Types of CSS
- CSS Versions
- Characteristics of CSS
- Advantages of CSS
- Disadvantages of CSS
Contact Us