Cascading Stylesheet CSS/CSS introduction

Ways to Add CSS

Updated on February 17, 2026
1 min read

There are three main ways:

1. Inline CSS

<h1 style="color:red;">Hello</h1>

2. Internal CSS

<style>
h1 { color: green; }
</style>

3. External CSS (Best practice)

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

Simple Example

HTML:

<p class="text">Welcome to CSS</p>

CSS:

.text {
  color: purple;
  font-weight: bold;
}