HTML Editors

Beginner
8 min read
Updated: Nov 2026
6 examples
Try It + VS Code

Definition and Usage

An HTML editor is where you write the markup this tutorial teaches— <html>, <head>, <body>, headings, paragraphs, and links—then preview it as a real web page.

What counts as an HTML editor in this tutorial?

Anything that lets you type tags and see (or save) HTML: CodeToFun Try It in the browser, desktop tools like Visual Studio Code, Cursor, and Sublime Text, or a plain editor like Notepad. The browser only needs a .html file (or an in-page preview)—not a special “HTML program.”

How this page fits the HTML learning path

After HTML Basic, you need a place to practice. This chapter shows the quickest practice loop (Try It), then how to work locally in VS Code so you can follow every later chapter—comments, CSS in HTML, tags, and attributes—with the same habits.

Learn HTML by editing HTML.

Prefer tools that show raw tags. That matches how this tutorial explains structure, attributes, and semantics.

Fastest start: Try It.

Every example below has Try It Yourself. Open it, change a tag, and watch the page update—ideal while you work through the HTML tutorial.

WYSIWYG is optional later.

Drag-and-drop page builders hide markup. Use them after you can read <h1> and <p> yourself.

Why You Need an Editor for HTML

HTML is plain text, but a good editor makes the tutorial easier:

FeatureHow it helps HTML learners
Syntax highlightingTags, attributes, and text use different colors—easier to spot a missing </p>
AutocompleteSuggests tag and attribute names as you type (IntelliSense in VS Code)
Live previewTry It or Live Server shows the page as you change markup
.html filesSave index.html, open in any browser—same file the tutorial describes
Multi-file projectsLink CSS and images from <head> like real sites

Start with CodeToFun Try It

For this HTML tutorial, Try It is the recommended first editor. No install, no project folder—edit the sample, run it, and move on to the next concept.

  1. Click Try It Yourself on any example on this site.
  2. Change headings, paragraphs, or attributes in the left panel.
  3. Run / preview to see how the browser paints your HTML.
  4. When you are ready for files and folders, install VS Code (or Cursor) and save the same markup as index.html.

Jump into a live HTML example

Open the minimal starter—edit tags and see the result in one click.

Open Try It →
Try ItWhat you practice
Example 1Minimal HTML document
Example 2header / main / footer structure
Example 3Semantic tags (nav, article)
Example 4HTML with CSS in <style>
Example 5Comments as section labels
Example 6Full starter template for VS Code

How to Write and Preview HTML

The same workflow whether you use Try It or VS Code.

  1. Create a file named index.html (or open Try It).
  2. Add <!DOCTYPE html>, <html>, <head>, and <body> as in HTML Basic.
  3. Put visible content in <body>—headings, paragraphs, links.
  4. Save, then open the file in a browser (or use Live Server / Try It preview).
  5. Change one tag at a time and refresh—that is how this tutorial builds skill.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>My first page</title>
</head>
<body>
  <h1>Hello, HTML</h1>
  <p>Saved from my editor.</p>
</body>
</html>

Copy this into VS Code or open Try It Example 1 and edit it live.

HTML Examples

Six starter patterns you will reuse throughout the HTML tutorial. Use View Output here, or Try It Yourself to edit in our online editor.

Example 1 — Minimal HTML File

HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>My first page</title>
</head>
<body>
  <h1>Hello, World!</h1>
  <p>I wrote this in an HTML editor.</p>
</body>
</html>
Try It Yourself

How It Works

  1. DOCTYPE + html start a valid HTML5 document.
  2. head holds the title; body holds visible content.
  3. Save as index.html in VS Code or edit in Try It.
  4. Open in a browser to confirm your first page.

Example 2 — Page Regions

HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Structured page</title>
</head>
<body>
  <header><h1>Site title</h1></header>
  <main><p>Main content goes here.</p></main>
  <footer><p>&copy; 2026 My Site</p></footer>
</body>
</html>
Try It Yourself

How It Works

  1. header / main / footer map how the page reads.
  2. viewport meta prepares mobile preview.
  3. Editors fold and search these regions easily.
  4. Try It to rearrange regions and see the layout change.

Example 3 — Semantic HTML

HTML
<header>
  <h1>My Blog</h1>
  <nav><a href="/">Home</a></nav>
</header>
<main>
  <article>
    <h2>First post</h2>
    <p>Semantic tags make code easier to navigate.</p>
  </article>
</main>
Try It Yourself

How It Works

  1. nav and article describe meaning, not just boxes.
  2. Matches later tag chapters in this tutorial.
  3. Highlighting in VS Code makes nesting obvious.
  4. Try It to add a second article and re-run.

Example 4 — HTML with CSS

HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>HTML + CSS</title>
  <style>
    body { font-family: system-ui, sans-serif; margin: 2rem; }
    h1 { color: #2563eb; }
    .card { padding: 1rem; border: 1px solid #e2e8f0; border-radius: 8px; }
  </style>
</head>
<body>
  <h1>Styled page</h1>
  <div class="card">
    <p>CSS can live in head or a linked file.</p>
  </div>
</body>
</html>
Try It Yourself

How It Works

  1. <style> in head styles the same HTML file.
  2. Desktop editors later split this into styles.css.
  3. See also How to Add CSS to HTML.
  4. Try It to change colors and re-preview.

Example 5 — Comments as Editor Bookmarks

HTML
<!-- ===== Header ===== -->
<header><h1>Portfolio</h1></header>
<!-- ===== Projects ===== -->
<section>
  <h2>Projects</h2>
  <p>Section comments help you jump around in your editor.</p>
</section>
<!-- ===== Footer ===== -->
<footer><p>Contact: [email protected]</p></footer>
Try It Yourself

How It Works

  1. <!-- --> labels regions without showing on the page.
  2. Search those labels in VS Code to jump fast.
  3. Next chapter: HTML Comments.
  4. Try It to add a new labeled section.

Example 6 — Starter Template for VS Code

HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My Website</title>
</head>
<body>
  <header><h1>Welcome</h1></header>
  <main>
    <h2>About this template</h2>
    <p>Save as index.html and start editing.</p>
  </main>
  <footer><p>&copy; 2026 My Website</p></footer>
</body>
</html>
Try It Yourself

How It Works

  1. Charset + viewport match real tutorial pages.
  2. Semantic layout ready to extend in later chapters.
  3. Paste into VS Code as your default starter.
  4. Try It first, then save locally when you are ready.

Edge Cases & Pitfalls

Small editor mistakes that break HTML practice.

ext

Wrong file extension

Save as .html (not .txt). On Windows, turn on “File name extensions” so Notepad does not hide the real type.

path

Opening the wrong file

After edits, confirm the browser tab points at the same index.html you saved in VS Code.

cache

Stale preview

Hard-refresh (Ctrl+F5) or use Live Server / Try It so you always see the latest markup.

wysiwyg

Learning only in visual builders

You miss tag practice. Stick to Try It or a text editor while learning HTML.

legacy

Discontinued editors

Atom and Brackets are retired. Prefer VS Code or Cursor for new learning setups.

online

Online-only forever

Playgrounds are great for Try It drills. Multi-page sites with images need a local folder eventually.

Key Takeaways

  • Try It first for every CodeToFun HTML example—fastest way to learn tags.
  • VS Code (or Cursor) is the recommended desktop editor for .html files.
  • HTML is plain text—Notepad works; editors just make practice easier.
  • Save → open in browser (or Live Server) after each change.

One line: Practice HTML in Try It, then write the same markup in VS Code as index.html and preview in your browser.

Frequently Asked Questions

An HTML editor is any tool where you write markup and save it as a .html file (or run it in a browser playground). In this HTML tutorial, that includes CodeToFun Try It, Visual Studio Code, Cursor, Sublime Text, and even Notepad.
Use Try It Yourself on each example. You edit HTML in the browser and see the result immediately—no install, no folders. Start with the minimal starter example on this page.
Visual Studio Code is the most common free choice: syntax highlighting, autocomplete, and the Live Server extension for auto-refresh preview. Cursor is a strong alternative if you want AI help while learning.
No. HTML is plain text. Notepad or TextEdit can create .html files. A code editor just makes tags easier to read and fewer mistakes. For this tutorial, Try It alone is enough to practice every example.
Save the file with a .html extension, then open it in Chrome, Edge, Firefox, or Safari (double-click or drag into the browser). In VS Code, install Live Server and click Go Live for automatic refresh.
Prefer writing tags yourself. WYSIWYG tools hide the markup that this tutorial teaches. Use Try It or a text editor so you see every <h1>, <p>, and attribute.

Practice HTML in Try It

Open the starter template, change the markup, and preview instantly.

Open Try It editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful