Introduction to HTML and CSS

HTML and CSS are the foundational technologies for building web pages. In this tutorial, we’ll cover the basics of HTML and CSS.

HTML Basics

HTML (HyperText Markup Language) is used to structure content on the web. Here’s a simple HTML document:

<!DOCTYPE html>
<html>
<head>
  <title>My First Web Page</title>
</head>
<body>
  <h1>Hello, world!</h1>
  <p>This is a paragraph.</p>
</body>
</html>

CSS Basics

CSS (Cascading Style Sheets) is used to style HTML content. Here’s how you can add some basic styles:

<!DOCTYPE html>
<html>
<head>
  <title>Styled Web Page</title>
  <style>
    body {
      font-family: Arial, sans-serif;
    }
    h1 {
      color: blue;
    }
    p {
      color: green;
    }
  </style>
</head>
<body>
  <h1>Hello, world!</h1>
  <p>This is a styled paragraph.</p>
</body>
</html>

By learning HTML and CSS, you’ll be able to create and style your own web pages.