Back to Learn
Web Dev • Beginner

HTML & CSS Fundamentals

Learn the foundational building blocks of the web and start creating your first structured, styled web page.

HTML CSS Cover

Introduction to HTML

HTML (HyperText Markup Language) is the standard markup language for documents designed to be displayed in a web browser. It defines the structure and content of a web page using various elements or "tags".

Here is a basic example of an HTML5 document structure:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>My First Page</title>
</head>
<body>
    <h1>Hello World!</h1>
    <p>Welcome to web development.</p>
</body>
</html>

Styling with CSS

While HTML defines the structure, CSS (Cascading Style Sheets) describes how HTML elements are to be displayed on screen. It controls layout, colors, fonts, and responsiveness.

Let's style the HTML we just wrote:

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    padding: 20px;
}

h1 {
    color: #0056b3;
}

Key Takeaway

HTML provides the skeleton of a webpage, while CSS provides the skin and styling. Together, they form the core of every website on the internet.