תגית <article>
הינה עצמאית ומגדירה אזור תוכן במסמך ה-HTML.
התוכן שיוזן בין התגיות עשוי להיות כתבה, מאמר, תגובה או הודעה.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
קטגוריה | תגיות לארגון תוכן. |
---|---|
תוכן מורשה |
<a>, <abbr>, <address>, <article>, <aside>, <audio>, <b>,<bdo>, <bdi>, <blockquote>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <data>, <datalist>, <del>, <details>, <dfn>, <div>, <dl>, <em>, <embed>, <fieldset>, <figure>, <footer>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <header>, <hgroup>, <hr>, <i>, <iframe>, <img>, <input>, <ins>, <kbd>, <keygen>, <label>, <main>, <map>, <mark>, <math>, <menu>, <meter>, <nav>, <noscript>, <object>, <ol>, <output>, <p>, <pre>, <progress>, <q>, <ruby>, <s>, <samp>, <script>, <section>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <table>, <template>, <textarea>, <time>, <ul>, <var>, <video>, <wbr>. |
תגיות הורים מורשות | תגית זו מורשת להופיע בגוף המסמך אך אינה חייבת להיות כפופה בצורה ישירה אל תגית <section> . |
ממשק DOM | HTMLElement |
תארים
תגית זו נכללת ברשימת התארים הגלובליים.
-
דוגמא
<article class="film_review"> <header> <h2>Jurassic Park</h2> </header> <section class="main_review"> <p>Dinos were great!</p> </section> <section class="user_reviews"> <article class="user_review"> <p>Way too scary for me.</p> <footer> <p> Posted on <time datetime="2015-05-16 19:00">May 16</time> by Lisa. </p> </footer> </article> <article class="user_review"> <p>I agree, dinos are my favorite.</p> <footer> <p> Posted on <time datetime="2015-05-17 19:00">May 17</time> by Tom. </p> </footer> </article> </section> <footer> <p> Posted on <time datetime="2015-05-15 19:00">May 15</time> by Staff. </p> </footer> </article>
הערות
- כותרת (<h1> - <h6>) משמשת לרוב כילד של האלמנט <article>.
- ניתן להשתמש באלמנט <article> כפוסט או תגובה כהתייחסות לפוסט החיצוני.
- ניתן להוסיף את פרטי המחבר באמצעות אלמנט <address>.
- ניתן להוסיף תאריך ואת שעת הפרסום התוכן באמצעות מאפיין datetime של אלמנט <time>.