add css
snippet in html

add stylesheet html

user9522

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

html style sheet

user5424

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

reference an external style sheet

user8449

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

Replace "mystyle.css" with the name of your css file.

how to link your css file to html

user7831

<link rel="stylesheet" href="styles.css">

style sheet link

user6842


  <!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> 

add css

user822

<!-- 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>