0
Q:

add css

 <link rel="stylesheet" type="text/css" href="mystyle.css">
20
<link rel="stylesheet" type="text/css" href="style.css">
1
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>

Replace "mystyle.css" with the name of your css file.
4
 <head>

       
      <link rel="stylesheet" type="text/css" href="theme.css">

    </head>
3
<link rel="stylesheet" href="styles.css">
2

  <!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" 
  href="mystyle.css">
</head>
<body>

<h1>This is a heading</h1>

  <p>This is a paragraph.</p>

</body>
</html> 
5
  <link rel="stylesheet" href="PathToYourFile.css">
18
Three ways to add CSS to the body of html:
	1)External CSS
	2)Internal CSS
	3)Inline CSS

1) Externally:  
    Type your css code in a file. Remember you file name.
	Then,
<head>
	<link rel="stylesheet" type="text/css" href="FileName.css" >
</head>

2) Internally:
	Type your cSS in the html file itself. (It is not preffered until
	little CSS code is to be added). This can be done by style tag.
	Example:
	<head>
	<style>
	h1 {
      text-color:red;
      text-size: 0.8em;
    }
    </style>
	</head>

3) Inline:
	This method is not used by developers as it is very lengthy and
	maintaining code becomes difficult.
	Example:
   <h1 style="color:blue;text-align:center;">Header file</h1>
5
<p style="color: blue; font-size: 46px;">
7
<link rel="stylesheet" href="hi.css">
0
<!-- External CSS -->
<!-- External styles are defined within the <link> element, inside the <head> section of an HTML page: -->
<!--  
body {
  background-color: lightblue;
}

h1 {
  margin-left: 20px;
}
-->
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
  <h1>Heading Text</h1>
</body>

<!-- Internal CSS -->
<!-- Internal styles are defined within the <style> element, inside the <head> section of an HTML page: -->
<head>
<style>
body {
  background-color: linen;
}

h1 {
  color: maroon;
  margin-left: 40px;
}
</style>
</head>
<body>
  <h1>Heading text</h1>
</body>

<!-- Inline CSS -->
<!-- Inline styles are defined within the "style" attribute of the relevant element: -->
<body>
  <h1 style="color:blue;text-align:center;">Heading Text</h1>
  <p style="color:red;">Paragraph Text.</p>
</body>
1

New to Communities?

Join the community