How
to add CSS file/Styling with HTML
Hello everyone , this Is the second Web
Development tutorial . In this I am gonna to tell you that how to add CSS file
in the HTML file or how to add styling in your web page using CSS.
CSS stands for Cascading Style Sheet is used to
style the different tags of HTML using their tag name/class name/ID name.
There are two different ways to style your page
:
1. Using separate CSS file
. Using style tag in same HTML file
Check out youtube video for better explanation[English]
Check out Youtube video for better explanation[Hindi]
Using
style tag
<!DOCTYPE html>
<html>
<head>
<title>Intoduction</title>
</head>
<body>
<header>
<h2>Coder99</h2></header>
<style>
Body
{
margin : 0px;
margin : 0px;
}
header
{
Background-color
: black;
Color
: white;
Padding
: 0.3em;
}
</style>
</body>
</html>
Using
separate CSS file
<!DOCTYPE html>
<html>
<head>
<title>Intoduction</title>
<link
rel="stylesheet" type="text/css" href="intro.css">
</head>
<body>
<header>
<h2>Coder99</h2></header>
</body>
</html>
//** Create a new CSS file named as intro.css :
**//
Body
{
margin : 0px;
margin : 0px;
}
Header
{
Background-color
: black;
Color
: white;
Padding
: 0.3em;
}
//** Save the file and use your own code as
well. Enjoy coding … !!! **//
Comments
Post a Comment