בפרק זה נכיר תגי HTML נוספים ושימושיים.
ראינו כבר את הכותרת <h1>
, אבל יש גם את <h2>
וכן הלאה עד <h6>
. ככל שהמספר גדול יותר כך הכותרת פחותה יותר בערכה. רצוי לחלק את מסמך ה-HTML לכותרות באופן כזה. בו נראה דוגמה למסמך המחולק לחלקים בעזרת כותרותיו:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <head> <title>Mission Statement</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <h1>Mission Statement</h1> <h2>Introduction</h2> <p> This is a mission statement for the Hebrew HTML tutorial. </p> <h2>The Objective</h2> <p> The objective is simple: teach whoever read the document - HTML. </p> <h2>Constraints</h2> <p> Here are some constraints: </p> <h3>#1: Valid HTML</h3> <p> Teach using Valid HTML. </p> <h3>#2: In Hebrew</h3> <p> Teach using <a href="http://en.wikipedia.org/wiki/Hebrew_language">Hebrew</a>. </p> </body> </html>
וכך זה נראה:
כפי שניתן לראות הכותרות בעלות המספר הגבוה יותר, קטנות יותר ובכך פחותות בחשיבותן.