Example

Adding CSS to HTML

HTML

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Adding CSS to HTML</title>
		
		<!-- External CSS --> 
		<!-- Added the styling to heading(h1) element : font color is set to White and background color is set to indigo -->
		<!-- custom.css : external css file contains the below code:
			h1 {
				color: white;
				background-color: indigo;
			}
		--> 
		<link rel="stylesheet" href="/notes/examples/assets/style/custom.css">

		<!-- Internal CSS -->
		<!-- Added the styling to paragraph element : border of indigo color  -->
		<style>
			p {
				border: 3px solid indigo;
			}
		</style>
	</head>
	<body>

		<h1>Demo: Adding CSS to HTML</h1> 
		
		<!-- Inline CSS -->
		<!-- Added the styling to paragraph element : font color is set to Blue  -->
		<p style="color: blue;">Lorem ipsum dolor sit amet consectetur adipisicing elit. Recusandae architecto porro distinctio ut nobis dolore adipisci quod nemo libero reprehenderit excepturi quisquam amet laudantium nesciunt sequi minima nostrum ipsum velit asperiores ad unde deleniti, numquam placeat est. A architecto minus facilis voluptas placeat, earum tenetur ipsam excepturi nesciunt molestiae recusandae id aliquid praesentium quod neque ea omnis facere. Expedita, voluptates.</p>

	</body>
</html>

Output

View original