Common XHTML Tags
Part of the HTML, XHTML, and CSS All-in-One For Dummies Cheat Sheet
To create Web pages with XHTML, you need to know the HTML tags to place and where to place them so that your pages look like the masterpieces you created. This table lists commonly used XHTML tags and explains where they go and whether they’re necessary.
| Tag | Function |
|---|---|
| <html></html> | Required for all pages |
| <head></head> | Required for all pages — must be inside HTML tags |
| <title></title> | Must be in head |
| <body></body> | Required for all pages — must be inside HTML tags |
| <link rel = "stylesheet" type = "text/css" href = "address" /> | Link to external style sheet. Replace address with URL of style sheet |
| <style type = "text/css"></style> | Page-level style sheet declaration |
| <h1></h1>...<h6></h6> | Defines headline from most prominent (h1) to least prominent (h6) |
| <p></p> | Paragraph |
| <div></div> | Generic block-level component |
| <span></span> | Generic inline component |
| <em></em> | Emphasis (default: italics) |
| <strong></strong> | Strong emphasis (default: bold) |
| <br /> | Line break |
| <ol></ol> | Defines an ordered list |
| <ul></ul> | Defines an unordered list |
| <li></li> | List item — must be inside ol or ul pair |
| <dl></dl> | Definition list — a list of terms and definitions |
| <dt></dt> | Definition term — found in dl groups |
| <dd></dd> | Definition data — usually paired with a dt set inside a dl |
| <a href = "address">content</a> | Displays content as a link and sends browser to address when activated |
| <img src = "filename" alt = "alternative text" /> | Displays image referenced by filename. Alternative text is required for non-visual browsers. |
| <table></table> | Define an HTML table |
| <tr></tr> | Table row |
| <th></th> | Table header — must be inside tr |
| <td></td> | Table data — must be inside tr |
| <script> //<![CDATA[ //]]> </script> |
Internal JavaScript code |
| <script src = "filename"></script> | Load external JavaScript code |
| <!--[if IE]> <![endif]--> |
Conditional comment. Code inside these tags will only be executed by Internet Explorer. It’s possible to indicate specific versions as well (<!--[if IE < 7]>). |
















Comments (0)
Leave a Reply