1/*
2Adding css file into html document
3*/
4
5<link rel="stylesheet" type="text/css" href="yourstylesheetname.css"> /* add this line into head tag of the file with change in file name. */
6
7/*
8I hope it will help you.
9Namaste
10*/
1Three ways to add CSS to the body of html:
2 1)External CSS
3 2)Internal CSS
4 3)Inline CSS
5
61) Externally:
7 Type your css code in a file. Remember you file name.
8 Then,
9<head>
10 <link rel="stylesheet" type="text/css" href="FileName.css" >
11</head>
12
132) Internally:
14 Type your cSS in the html file itself. (It is not preffered until
15 little CSS code is to be added). This can be done by style tag.
16 Example:
17 <head>
18 <style>
19 h1 {
20 text-color:red;
21 text-size: 0.8em;
22 }
23 </style>
24 </head>
25
263) Inline:
27 This method is not used by developers as it is very lengthy and
28 maintaining code becomes difficult.
29 Example:
30 <h1 style="color:blue;text-align:center;">Header file</h1>
1<p style="color: red; padding: 10px;background-color: blue;">
2 using inline style to design this paragraph
3</p>