Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> JavaScript

Element <section> และ <article> ใน HTML5 มีประโยชน์จริงไหม?

มีประโยชน์มากสำหรับ Accessibility และ SEO

<section> และ <article> ช่วย Screen Readers และอุปกรณ์ช่วยเหลือเข้าใจโครงสร้างเนื้อหา ดีต่อผู้ใช้งานที่มีปัญหาด้านสายตา และ eBook readers

ตัวอย่าง <section>

<section>
  <h1>Java</h1>
  <h3>Inheritance</h3>
  <p>Inheritance defines the relationship between superclass and subclass.</p>
</section>

ตัวอย่าง <article>

<main>
  <h1>Learning</h1>
  <article>
    <h3>Web Development Tutorials</h3>
    <p>CSS, HTML, PHP tutorials...</p>
  </article>
  <article>
    <h3>Academic Tutorials</h3>
    <p>Computer Fundamental, Network tutorials...</p>
  </article>
</main>

<section> = กลุ่มเนื้อหาที่เกี่ยวข้อง | <article> = เนื้อหาอิสระที่เผยแพร่ได้แยกต่างหาก