How to Add CSS

CSS is added to HTML pages to format the document according to information in the style sheet. There are three ways to insert CSS in HTML documents.

  • Inline CSS
  • Internal CSS
  • External CSS
  • 1) Inline CSS

Inline CSS is employed to implement CSS styles directly on a specific line of code or element.

Example

Example

<p style="color:blue">Hello CSS</p>

For more visit here: Inline CSS

2) Internal CSS

Internal CSS is employed to implement CSS styling on a specific document or webpage, influencing all its elements. This CSS code is typically enclosed within the style tag located in the head section of the HTML document.

Example

Example

<style>

p{color:blue}

</style>

For more visit here: Internal CSS

3) External CSS

External CSS is employed to implement CSS across multiple or all pages. In this case, the CSS code is written in a separate CSS file with a file extension of .css, such as style.css.

style.css

Example

p{color:blue}

You must connect the style.css file to your HTML pages in this manner:

Example

Example

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

The hyperlink tag should be placed within the head section of an HTML document.

For more visit here: External CSS

Input Required

This code uses input(). Please provide values below: