Comments and neat nesting
หน้านี้ต้องใช้เบราว์เซอร์ล่าสุด (รองรับ SharedArrayBuffer) กรุณาอัปเดต Chrome, Edge, Firefox หรือ Safari เป็นเวอร์ชันล่าสุด
_heading
- Comment คือหมายเหตุสำหรับ คุณ ไม่ใช่สำหรับผู้อ่าน
- เบราว์เซอร์ ข้าม มัน — มันไม่เคยแสดงบนหน้าเว็บ
- เขียนรูปแบบดังนี้:
<!-- this is a comment -->
English
<!-- The header goes here -->
<h1>Welcome</h1>
<!-- TODO: add a photo below -->
แท็กอยู่ภายในแท็ก
- แท็ก HTML ซ้อนกัน: คู่หนึ่งสามารถอยู่ภายในอีกคู่หนึ่งได้
- A
<div>is a plain box you can put other things in. - ขยับแท็กด้านในออกเล็กน้อย เพื่อให้การซ้อนอ่านง่าย
English
<div>
<h2>My card</h2>
<p>Some text inside the box.</p>
</div>
ข้อผิดพลาดที่พบบ่อย
- Tags must nest, not overlap:
<b><i>x</i></b>, never<b><i>x</b></i>. - คอมเมนต์คือ
<!-- ... -->และเบราว์เซอร์จะข้ามการแสดงผลไป
ลองดูเลย
- Comment ช่วยให้คุณจัดระเบียบ; การซ้อนสร้างโครงสร้าง
- Leave a comment, then nest a paragraph inside a
<div>.
สำรวจ
Neat nesting = the tree
Indentation in your HTML mirrors the parent/child tree.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Leave a note for yourself. Add a comment, like <!-- TODO: add a photo -->.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Put the paragraph inside a box. Wrap it in a <div> … </div>.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Group the recipe. Put the <h2> และ the <ul> together inside one <div>, and indent them inside it.