How to Add CSS to HTML

CSS can be added to an HTML document in three main ways: Inline CSS, Internal CSS, and External CSS. Each method has its use cases depending on the needs of your project.

1. Inline CSS

Inline CSS is used directly within HTML elements using the style attribute. It is best for small changes that apply to a single element.

Inline CSS:Key Points