Loading Page Content...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
In Topics 1.1 and 1.2, you learned what HTML is and what a standard HTML document looks like. Now comes the practical question: Where do we write our HTML code?
You can write HTML in basic Windows Notepad. But in Notepad, all text looks plain black, there is no automatic error checking, and you have to manually refresh your browser every time you make a change.
Imagine writing with a plain wooden pencil versus having a Smart Digital Pen that:
That smart software is called a Code Editor. The most popular, fastest, and 100% free code editor in the world is Visual Studio Code (VS Code), made by Microsoft.
| Feature | Windows Notepad | Visual Studio Code |
|---|---|---|
| Color Coding (Syntax Highlighting) | ❌ Everything is plain black | ✅ Tags, attributes, and text are displayed in bright, distinct colors |
| Auto-Complete (IntelliSense) | ❌ You must type every letter manually | ✅ Typing <p automatically closes </p> for you |
| Instant Boilerplate (Emmet) | ❌ Not available | ✅ Typing ! and pressing Enter generates the full boilerplate in 1 second |
| Live Server | ❌ Manually press F5 to reload | ✅ Saving your code (Ctrl + S) automatically refreshes the browser |
| Price | Free | 100% Free (by Microsoft) |
Installing VS Code on your computer or laptop is very easy:
Open your browser and visit: code.visualstudio.com
Click the big blue button: "Download for Windows" (or Mac / Linux). The setup file will download to your computer.
Double-click the downloaded .exe file to begin installation.
During the installation, you will see a screen with several checkboxes. Make sure to check (tick) these two options:
These options allow you to right-click on any project folder and immediately open it in VS Code!
Click "Next", then "Install". Within 1 to 2 minutes, the installation will finish. Click "Finish" to open VS Code.
Now let us set up your workspace to write your first webpage:
On your computer (on the Desktop or in your D: Drive), create a new folder named: html-practice.
html-practice folder.index.html and press Enter.index.html?
Every web server and browser looks for index.html as the default home page of a website. That is why developers always name their primary webpage index.html.You do not need to manually type the whole boilerplate skeleton every time!
index.html file, type just an exclamation mark: !Enter or Tab on your keyboard.💥 Boom! The complete HTML5 boilerplate code will instantly appear on your screen:
Normally, whenever you make a change in your code, you have to switch to your browser and press F5 (Reload).
With the Live Server extension, whenever you save your file (Ctrl + S), the browser reloads automatically without you having to press anything!
Ctrl + Shift + X).Live Server.<body> of your index.html, add some content:Ctrl + S (Save). Watch your browser update instantly!<h1> to <h2>), it automatically updates the closing tag to </h2> too. You do not have to rename it twice!Shift + Alt + F.Remembering these shortcuts will speed up your coding:
| Shortcut | Action |
|---|---|
Ctrl + S | Save file (Get into the habit of pressing this often!) |
Shift + Alt + F | Format code neatly |
Ctrl + / | Add or remove a comment |
Ctrl + B | Show or hide the left sidebar |
Ctrl + Shift + X | Open the Extensions Marketplace |
Alt + Up/Down Arrow | Move a line of code up or down |
index.html.! and press Enter to instantly generate the full HTML5 boilerplate (Emmet).Ctrl + S).Every paired tag must have a matching closing tag with a forward slash /:
While browsers tolerate <H1> or <P>, standard modern W3C HTML5 code conventions strictly use lowercase tag and attribute names:
Test your understanding with these questions:
code.visualstudio.com.my-first-site.index.html.! shortcut to generate your boilerplate.<body>, add your name and school name.In the next lesson, we will continue your web development journey with Elements (Introduction).
Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
| Previous Lesson | Next Lesson |
|---|---|
| Basic Document Structure | Elements |
Test your understanding of this lesson with 5 questions. Each question has one correct answer.