Introduction to CSS

This example demonstrates the basics of CSS (Cascading Style Sheets), which is used to style and layout web pages.

Types of CSS

There are three types of CSS:

Inline CSS Example

This paragraph is styled with inline CSS, which sets the text color to blue.

Internal CSS Example

This paragraph is styled with internal CSS defined within the <style> tag in the <head> section.

External CSS Example

This paragraph is styled with external CSS defined in a separate CSS file called styles.css.

Padding vs. Margin

Padding is the space between the content and the border of an element. It adds space inside the element.

Margin is the space outside the border of an element. It adds space outside the element.