DEV Community

Cover image for πŸ”₯ HTML Refresher Series – Part 1: Getting Started with HTML
Sharad Aade
Sharad Aade

Posted on

πŸ”₯ HTML Refresher Series – Part 1: Getting Started with HTML

HTML is the foundation of every website.

In this series, we’ll go from basics β†’ in-depth β†’ best practices with code snippets and mini projects.

Let’s start with Part 1: Getting Started with HTML πŸš€

πŸ“Œ What is HTML?

HTML (HyperText Markup Language) is the skeleton of a webpage.

It tells the browser what content is on the page (text, images, links, forms).

CSS handles styling, and JavaScript handles interactivity.

Think of HTML as the structure of a house, CSS as the paint & design, and JavaScript as the electricity & movement.

πŸ“Œ The Basic Structure

Every HTML document follows a common structure:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Hello World</title>
</head>
<body>
  <h1>Welcome to HTML!</h1>
  <p>This is my first web page.</p>
</body>
</html>
Enter fullscreen mode Exit fullscreen mode

πŸ‘‰ Let’s break it down:

  • <!DOCTYPE html> β†’ tells the browser this is an HTML5 document.
  • <html> β†’ wraps everything on the page.
  • <head> β†’ contains metadata (title, description, CSS/JS links).
  • <body> β†’ contains visible content.

πŸ“Œ Headings & Paragraphs

Headings define content hierarchy.

<h1>Main Title</h1>
<h2>Subtitle</h2>
<h3>Smaller Heading</h3>
<p>This is a paragraph of text.</p>
Enter fullscreen mode Exit fullscreen mode

Text Formatting:

<p>I love <strong>coding</strong> and <em>coffee</em>.</p>
<p>This is <mark>important</mark> text.</p>
Enter fullscreen mode Exit fullscreen mode
  • <strong> β†’ bold + importance
  • <em> β†’ italics + emphasis
  • <mark> β†’ highlighted text

πŸ“Œ Links:

<a href="https://dev.to" target="_blank">Visit Dev.to</a>
Enter fullscreen mode Exit fullscreen mode
  • href β†’ destination URL
  • target="_blank" β†’ opens in new tab

πŸ“Œ Images:

<img src="cat.jpg" alt="Cute cat smiling">
Enter fullscreen mode Exit fullscreen mode
  • src β†’ path of image
  • alt β†’ description (important for accessibility & SEO)

πŸ“Œ Mini Project: β€œHello World” Page:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Hello World</title>
</head>
<body>
  <h1>Hello, World!</h1>
  <h2>About Me</h2>
  <p>My name is Sharad and I love <strong>coding</strong> + <em>coffee</em>.</p>

  <h2>Find Me Online</h2>
  <p>
    <a href="https://dev.to" target="_blank">Follow me on Dev.to</a>
  </p>

  <h2>My Cat</h2>
  <img src="cat.jpg" alt="A cute cat sitting on the sofa">
</body>
</html>

Enter fullscreen mode Exit fullscreen mode

Top comments (0)