Setting Up Your First HTML Page
Create and open your very first HTML file, and see how a browser renders it.
អាន 1 នាទី
You don't need to install anything to start writing HTML — just a text editor and a browser.
Create the file
Create a new file named index.html and add this:
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>This is my first HTML page.</p>
</body>
</html>Save it, then open it by double-clicking the file (or dragging it into a browser window). You should see "Hello, world!" as a large heading, followed by the paragraph text.
What each piece does
<!DOCTYPE html>tells the browser this is a modern HTML document. It always goes first, on its own line.<html>wraps the entire page.<head>holds information about the page — metadata, the page title, links to stylesheets — none of which is displayed directly on the page itself.<title>sets the text shown in the browser tab.<body>holds everything that's actually visible: text, images, buttons, links.
.html files are just text
There's nothing magic about the .html extension — it's a plain text file that tells your operating system (and browser) how to interpret it. You can open it in any text editor: VS Code, Notepad, Sublime Text, whatever you already have.
A quick habit worth building
As you go through this course, don't just read the code examples — type them out yourself and open the result in a browser. HTML gives you instant, visible feedback, which makes it one of the easiest languages to actually see yourself learning.