CSS- Cascading Style Sheet
CSS is a set of rules (or formatting properties) that applies to a specific element in the web-page.
It is mainly used for formatting or designing the web-page contents.
CSS can be included in three different ways :-
- Inline
- Embedded under HEAD tag
- External Style-sheet
example:
1.INLINE
<html>
<head>
</head>
<body>
<div class="abc">
<p style="color:red;">Hello World</p>
</div>
</body>
</html>
output:
2. Embedded under HEAD tag
<html>
<head>
<style>
.abc
{
color:green;
}
</style>
</head>
<body>
<div class="abc">
Hello World
</div>
</body>
</html>
output:
3. Stylesheet
<html>
<head>
<link rel="stylesheet" href="stylesheet.css">
</head>
<body>
<div class="abc">
Hello World
</div>
</body>
</html>
External File:
stylesheet.css
.abc
{
color:blue;
font-size:25px;
}
output:
Comments
Post a Comment