css include code example

Example 1: add stylesheet html

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

Example 2: easy way to import cs html

<link rel=“stylesheet” type=“text/css” href=“index.css” />

Example 3: import css in another css file

@import "navigation.css"; /* Via string */

or

@import url("navigation.css"); /* Via url */

Example 4: how to add a css file in html

<!DOCTYPE html>
<html>
<head>

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

</head>
<body>

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

</body>
</html>

Example 5: css without separate file

just add any style inside the first <p> or other element tag using style=" ;" 
<p style="font-size: xx-large;">test</p>

Tags: