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)