Comments and neat nesting
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Halaman ini memerlukan browser terbaru (dengan dukungan SharedArrayBuffer). Silakan perbarui Chrome, Edge, Firefox, atau Safari ke versi terbaru.
English
Comments
- A comment is a note for you, not for the reader.
- The browser ignores it — it never shows on the page.
- Write it like this:
<!-- this is a comment -->.
Bahasa Indonesia
Komentar
- Sebuah komentar adalah catatan untuk Anda, bukan untuk pembaca.
- Browser mengabaikannya — ia tidak pernah muncul di halaman.
- Tulislah seperti ini:
<!-- this is a comment -->.
<!-- The header goes here -->
<h1>Welcome</h1>
<!-- TODO: add a photo below -->
English
Tags go inside tags
- HTML tags nest: one pair can sit inside another.
- A
<div>is a plain box you can put other things in. - Indent the inside tags a little, so the nesting is easy to read.
Bahasa Indonesia
Tag masuk ke dalam tag
- Tag HTML bersarang: satu pasangan dapat berada di dalam pasangan lainnya.
- Sebuah
<div>adalah kotak polos tempat Anda dapat memasukkan hal lain. - Ratakankan tag di dalamnya sedikit, agar bersarangnya mudah dibaca.
<div>
<h2>My card</h2>
<p>Some text inside the box.</p>
</div>
English
Common mistakes
- Tags must nest, not overlap:
<b><i>x</i></b>, never<b><i>x</b></i>. - A comment is
<!-- ... -->and is ignored by the browser.
Bahasa Indonesia
Kesalahan umum
- Tag harus bersarang, bukan tumpang tindih:
<b><i>x</i></b>, jangan<b><i>x</b></i>. - Komentar adalah
<!-- ... -->dan diabaikan oleh browser.
English
Now you try
- Comments help you stay organised; nesting builds structure.
- Leave a comment, then nest a paragraph inside a
<div>.
Bahasa Indonesia
Sekarang Anda coba
- Komentar membantu Anda tetap teratur; bersarang membangun struktur.
- Tinggalkan komentar, lalu bersarangkan sebuah paragraf di dalam
<div>.
Explore · Jelajahi
Neat nesting = the tree
Indentation in your HTML mirrors the parent/child tree.
Leave a note for yourself. Add a comment, like <!-- TODO: add a photo -->.
Put the paragraph inside a box. Wrap it in a <div> … </div>.