CSS : What is CSS, Types of CSS, How we apply CSS in a website, Inline CSS, Internal CSS, External CSS, with pdf notes on CSS
Cascading Style Sheet (CSS)
CSS stands for cascading style sheet. It helps us to make webpage beautiful. In normal words we can say CSS is a beauty parlor of any simple HTML page. Let's see with an example:

These are two welcome notes for my website. First one have only HTML but in second we applied CSS to beautify it. You can easily notice a border and background colors in the second one.
I hope its clear to you that CSS is came into picture just to beautify a simple webpage.
Types of CSS:
On the basis of how they are applied to a website we have three types of CSS:
- Inline CSS
- Internal CSS
- External CSS
How we apply CSS in a website:
Let's see a brief view on all three types of CSS in short and if you wanna understand them clearly kindly visit them by clicking on link above
Inline CSS :
<!DOCTYPE html>
<html>
<head>
<title>Inline CSS</title>
</head>
<body>
<p style="font-family: Lucida Console; font-size: 20px; background-color: green;">
This text have Inline CSS
</p>
</body>
</html>
The above written code have inline css (To understand Inline CSS click here...........)
Internal CSS:
<!DOCTYPE html>
<html>
<head>
<title>Internal CSS</title>
</head>
<body>
<p>
This text have Internal CSS
</p>
</body>
<style type="text/css">
p{font-family: Lucida Console; font-size: 20px; background-color: green;}
</style>
</html>
Above code have an Internal CSS applied in it (click here to learn Internal CSS............)
External CSS:
<!DOCTYPE html>
<html>
<head>
<title>External CSS</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
<p>
This text have External CSS
</p>
</body>
</html>
You may have tries to run these code in your computer. And you found a result in Inline and internal css but did not found any styling in case of external CSS. This is because we don't write CSS code for external css inside HTML document. We create a separate file with aName.css and write the link of file in the head tag and write al css codes in the same. And the link we have written stylesheet.css does not exist.
To read all three css click on the link below
Comments
Post a Comment