SlideShare a Scribd company logo
1 of 7
Download to read offline
Interactive Media Center
                                                                     http://library.albany.edu/imc/
                                HTML & XHTML Tag Quick Reference

This reference notes some of the most commonly used HTML and XHTML tags. It is not, nor is it intended to
be, a comprehensive list of available tags. Details regarding the proper use of XHTML are at the end of this
document.

                                                Basic Document Tags
            What It Is                                                     What It Does
          <html></html>               Indicates the start and end of an HTML Document
                                      Defines the portion of the document that contains essential formatting information. The
         <head></head>
                                      material in the head is invisible.
         <body></body>                Defines the portion of the document that contains the visible information.

                                                   Body Attributes
                                Not supported in HTML5. Use Cascading Style Sheets.
            What It Is                                                     What It Does
                                    Specifies the background color
       <body bgcolor=?>
                                    Not supported in HTML5. Use Cascading Style Sheets.
                                    Specifies the text color
         <body text=?>
                                    Not supported in HTML5. Use Cascading Style Sheets.
                                    Specifies the color of unfollowed links.
          <body link=?>
                                    Not supported in HTML5. Use Cascading Style Sheets.
                                    Specifies the color of followed links.
         <body vlink=?>
                                    Not supported in HTML5. Use Cascading Style Sheets.
                                    Specifies the color of links when they are clicked.
         <body alink=?>
                                    Not supported in HTML5. Use Cascading Style Sheets.
NOTE: Body attributes may be combined within the body tag. Example:
<body bgcolor="#FFFFFF" text="#000000" link="#0000CC" vlink="#33CC00" alink="#FF0000">
                                Not supported in HTML5. Use Cascading Style Sheets.

                                                        Text Tags
            What It Is                                                       What It Does
       <hl></hl>,<h2></h2>,           The heading tags indicate the importance of a heading ranging from the most important,
      <h3></h3>,<h4></h4>,            h1, to the least important, h6. These specifications are intended to denote the
      <h5></h5>,<h6></h6>             importance data below the heading.
             <tt></tt>                Specifies a typewriter or teletype-like text.
                                      Creates an emphasis on text that is rendered usually as italics, but sometimes as bold
           <em></em>
                                      depending on the browser.
                                      Creates an emphasis on text that is usually rendered as bold, but sometimes as italics
        <strong></strong>
                                      depending on the browser.
                                      Specifies the font size from 1 to 7. 1 is the smallest, 7 the largest, and 3 is generally the
       <font size=?></font>           default size.
                                      The font tag is not supported in HTML5. Use Cascading Style Sheets.
                                      Specifies font color.
       <font color=?></font>
                                      The font tag is not supported in HTML5. Use Cascading Style Sheets.



NOTE: Font attributes may be          NOTE: The font tag is not supported in HTML5. Use Cascading Style Sheets.
combined within the font tag.
Example:
          <font size="4"
Roger Lipera 011/12 v5                                          1                                          Interactive Media Center
  rlipera@albany.edu                                                                                http://library.albany.edu/imc/
                                This and other free handouts are available on our Web site.
Interactive Media Center
                                                                   http://library.albany.edu/imc/
  color="#33FF00">Example of
 combined font attributes. </font>



                                             Common Formatting Tags
          What It Is                          What It Is                             What It Does
      (HTML 4.0 & Earlier)                (XHTML & HTML5)
          <p></p>                              Same            Defines a paragraph.
         <p align=?>                           Same            Defines paragraph alignment left, right, or center.
            <br>                               Same            Inserts a line break.
                                               Same            Defines a block quote and indents text from both
<blockquote></blockquote>                                      sides. Usually with some extra space above and
                                                               below.
             <ol></ol>                         Same            Defines the beginning and end of an ordered list.
             <ul></ul>                         Same            Defines the beginning and end of an unordered list.
                                               Same            Defines the beginning and end of a line within a list.
             <li></li>                                         Start a line with a number in an ordered list, and with
                                                               a bullet in an unordered list.

                                                      Image Tags
        What It Is (HTML)                 What It Is (XHTML)                               What It Does
        <img src="name">                  <img src="name" />          Places and image.
                                                                      Specifies the alignment of an image; left, right, center;
    <img src="name" align=?>           <img src="name" align=? />
                                                                      bottom, top, middle
                                      <img src="name" border=?        Specifies a border around and image.
   <img src="name" border=?>
                                                  />
                                     <img src”=name” alt=”name”       Specifies the alternative label for an image. This is
 <img src”=name” alt=”name”>
                                                  />                  especially important for use nongraphical browsers.
NOTE: Attributes within the img tag may be combined.

Example in HTML:
<img src="images/fisherman.jpg" width="209" height="214" alt="Our Founder">

Example in XHTML:
<img src="images/fisherman.jpg" width="209" height="214" alt="Our Founder" />

                                                Horizontal Rule Tags
        What It Is (HTML)                 What It Is (XHTML)                             What It Does
              <hr>                               <hr />            Specifies the start of a horizontal rule.
          <hr size=?>                       <hr size=? />          Specifies the height of a horizontal rule.
                                                                   States that the horizontal rule should have no shade.
          <hr noshade>                     <hr noshade />
NOTE: Attributes within the horizontal rule tag may be combined.

Example in HTML: <hr noshade width="75%" size="4">

Example in XHTML: <hr noshade width="75%" size="4" />




Roger Lipera 011/12 v5                                         2                                        Interactive Media Center
 rlipera@albany.edu                                                                              http://library.albany.edu/imc/
                                This and other free handouts are available on our Web site.
Interactive Media Center
                                                                http://library.albany.edu/imc/

                                                   Table Tags
                    What It Is                                                    What It Does
                  <table></table>                    Specifies the beginning and end of a table.
                     <tr></tr>                       Specifies the beginning and end of a table row.
                     <td></td>                       Specifies the beginning and end of a table cell.
                     <th></th>                       Defines a table header. A normal cell with text that is bold and
                                                     centered.
                 <table border=#>                    Specifies the size of the border around a table and cells within the
                                                     table.
               <table cellspacing=#>                 Specifies the space between cells.
               <table cellpadding=#>                 Specifies the amount of space between the border of a cell and the
                                                     items within the cell.
                <table width=”?”>                    Specifies the width of a table in either pixels or percent.
                   <tr align=?>                      Specifies the alignment of contents in a row of cells as either left,
                                                     right, or center.
                   <td align=?>                      Specifies the alignment of contents in a cell as either left, right, or
                                                     center.
                   <tr valign=?>                     Specifies the vertical alignment of contents in a row of cells as either
                                                     top, bottom, or middle.
                  <td valign=?>                      Specifies the vertical alignment of contents in cell as either top,
                                                     bottom, or middle.
                 <td colspan=#>                      Specifies the number of columns a cell will span.
                 <td rowspan=#>                      Specifies the number of rows a cell will span.
                   <td nowrap>                       Stops text from automatically line wrapping.




XHTML can be thought of as an upgraded and stricter version of HTML 4.01, while HTML 5 is an expansion
and clarification of the markup language for the Web. Neither XHTML nor HTML 5 is particularly difficult to
write. However, there are some important techniques to writing properly formed code. There are some simple
rules that must be followed. The most important rules are:

   •   Tags must all be in lower case.
   •   Elements must be nested correctly.
   •   Tag elements must be closed.
   •   Documents must be well-formed

Examples of lower case rule:

       <STRONG>This is incorrect.</STRONG>

       <strong>This is correct.</strong>




Roger Lipera 011/12 v5                                     3                                          Interactive Media Center
 rlipera@albany.edu                                                                            http://library.albany.edu/imc/
                              This and other free handouts are available on our Web site.
Interactive Media Center
                                                             http://library.albany.edu/imc/


Examples of the nesting rule:

       <strong><em>This is incorrect nesting.</strong><em>

       <strong><em>This is correct nesting.</em></strong>

Examples of the closed tag rule:

 This horizontal rule tag is not closed- <hr>

 This horizontal rule tag is closed- <hr />

 This image tag is not closed- <img source=”/images/picture.jpg” alt=”Cows in a pasture”>



This image tag is properly closed- <img source=”/images/picture.jpg” alt=”Cows in a pasture” />

Examples of the well-formed document rule:

       XHTML documents must have the proper structure. This means all components must be within the
       opening and closing HTML tags, <html></html>. Internal elements must be correctly nested and
       located properly. The basic components and structure of an XHTML document are-

               <html>
                  <head>
                  </head>
                  <body>
                  </body>
               </html>




Roger Lipera 011/12 v5                                  4                                        Interactive Media Center
 rlipera@albany.edu                                                                       http://library.albany.edu/imc/
                            This and other free handouts are available on our Web site.
Interactive Media Center
                                                             http://library.albany.edu/imc/


                                     XHTML/HTML 5 Syntax Rules


XHTML and HTML 5 require that some basic rules of syntax be followed. As with the tag rules noted above,
XHTML and HTML 5 syntax is not much more difficult that correctly formed HTML 4.0. These rules are,
however, much stricter and must not be violated. These rules follow.

   •   Attributes must be quoted.
   •   The Name attribute is replaced by the ID attribute
   •   Attribute shorthand must not be used.
   •   DOCTYPE statement must be used. (The DOCTYPE statement is part of Document Type Definition,
       DTD, and is used to specify which syntax is used in the Web page.)

Examples of the quoted attribute rule:

       This is incorrect- <table width=75% bgcolor=ff0000>

       This is correct- <table width-“75” bgcolor=”ff0000”>

Examples of the Name attribute replacement rule:

       This is incorrect- <img src=”/images/cows.jpg” name=”photo12” />

       This is the correct substitution- <img src=”/images/cows.jpg” id=”photo12” />

Examples of the no shorthand rule:

       This is an example of improper shorthand- <input checked>

       This is the same tag correctly written without shorthand- <input checked=”checked”

Examples of DOCTYPE statements:

       Invalid “old-style” DOCTYPE statement:

         <html>
           <head>
             <title>This is a page without a statement</title>
           </head>
           <body>
           </body>
         </html>

Roger Lipera 011/12 v5                                  5                                        Interactive Media Center
 rlipera@albany.edu                                                                       http://library.albany.edu/imc/
                            This and other free handouts are available on our Web site.
Interactive Media Center
                                                             http://library.albany.edu/imc/


       XHTML DOCTYPE statement:

         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
         <html>
           <head>
             <title>Example of a page with a DOCTYPE statement</title>
           </head>
           <body>
           </body>
         </html>


HTML 5 DOCTYPE statement:

               <!DOCTYPE HTML>
               <html>
                   <head>
                     <title>Example of a page with a DOCTYPE statement</title>
                   </head>
                   <body>
                   </body>
                 </html>

Note that the DOCTYPE statement goes ahead of the opening HTML tag, <html>. The statement is not part of
the HTML document and does not have a closing tag. It is used to tell a browser how to render the document.
There are three XHTML DOCTYPE statements.

Statement used to create clutter-free pages that must follow rules exactly when Cascading Style Sheets are used:

       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Statement used when HTML presentational features are present and when it is desirable to support older
browsers that do not fully understand Cascading Style Sheets:

       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">




Roger Lipera 011/12 v5                                  6                                        Interactive Media Center
 rlipera@albany.edu                                                                       http://library.albany.edu/imc/
                            This and other free handouts are available on our Web site.
Interactive Media Center
                                                              http://library.albany.edu/imc/

Statement used when frames are incorporated into the design of the page (note that frames are an obsolete
design technique and are not used in modern page designs):


       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

HTML5 has only the one DOCTYPE statement noted above.

                                                About HTML 5

At the time of this writing, HTML 5 remains in a non-official state. Many Web page builders are starting to
incorporate elements of HTML 5 into their projects. All current browsers support some HTML 5 components,
but no browser supports everything outlined in the HTML 5 rules. One primary reason for this is that the HTML
5 rules are being constantly updated as problems are worked out.

HTML 5 has many new tags. It is necessary to understand that the purpose of HTML is to specify what
something is. For instance, HTML identifies a page element as a link, a list, a paragraph, or some other sort of
object. Presentation is controlled by Cascading Style Sheets. In other words, HTML specifies that an object is,
for instance, a link, but not what color the link is.

HTML 5 expands the list of tags by providing more options for identification. It is now possible to identify
headers, footers, sections, audio, video, and much more. The expansion of HTML tags and the ability of
browsers to understand these new tags will improve the usability of the World Wide Web and result in new
methods of presentation with better results. It also means that we can expect less variation in the appearance and
operation of Web pages when viewed with different browsers and operating systems.




Roger Lipera 011/12 v5                                   7                                        Interactive Media Center
 rlipera@albany.edu                                                                        http://library.albany.edu/imc/
                             This and other free handouts are available on our Web site.

More Related Content

What's hot

Web I - 02 - XHTML Introduction
Web I - 02 - XHTML IntroductionWeb I - 02 - XHTML Introduction
Web I - 02 - XHTML IntroductionRandy Connolly
 
HTML & CSS Workshop Notes
HTML & CSS Workshop NotesHTML & CSS Workshop Notes
HTML & CSS Workshop NotesPamela Fox
 
html
htmlhtml
htmltumetr1
 
A quick guide to Css and java script
A quick guide to Css and  java scriptA quick guide to Css and  java script
A quick guide to Css and java scriptAVINASH KUMAR
 
php 1
php 1php 1
php 1tumetr1
 
Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Hatem Mahmoud
 
Html and Xhtml
Html and XhtmlHtml and Xhtml
Html and XhtmlChhom Karath
 
HTML/CSS Lecture 1
HTML/CSS Lecture 1HTML/CSS Lecture 1
HTML/CSS Lecture 1Lee Lundrigan
 
(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS Dave Kelly
 
Intro webtechstc
Intro webtechstcIntro webtechstc
Intro webtechstccmcsubho
 
HTML 5 Simple Tutorial Part 1
HTML 5 Simple Tutorial Part 1HTML 5 Simple Tutorial Part 1
HTML 5 Simple Tutorial Part 1Sanjeev Kumar
 
html for beginners
html for beginnershtml for beginners
html for beginnersKIIZAPHILIP
 
HTML Foundations, pt 2
HTML Foundations, pt 2HTML Foundations, pt 2
HTML Foundations, pt 2Shawn Calvert
 
HTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsSun Technlogies
 
The complete-html-cheat-sheet
The complete-html-cheat-sheetThe complete-html-cheat-sheet
The complete-html-cheat-sheetHARUN PEHLIVAN
 

What's hot (19)

Web I - 02 - XHTML Introduction
Web I - 02 - XHTML IntroductionWeb I - 02 - XHTML Introduction
Web I - 02 - XHTML Introduction
 
html-css
html-csshtml-css
html-css
 
HTML & CSS Workshop Notes
HTML & CSS Workshop NotesHTML & CSS Workshop Notes
HTML & CSS Workshop Notes
 
html
htmlhtml
html
 
A quick guide to Css and java script
A quick guide to Css and  java scriptA quick guide to Css and  java script
A quick guide to Css and java script
 
CSS notes
CSS notesCSS notes
CSS notes
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
php 1
php 1php 1
php 1
 
Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01
 
Html and Xhtml
Html and XhtmlHtml and Xhtml
Html and Xhtml
 
HTML/CSS Lecture 1
HTML/CSS Lecture 1HTML/CSS Lecture 1
HTML/CSS Lecture 1
 
Html cia
Html ciaHtml cia
Html cia
 
(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS
 
Intro webtechstc
Intro webtechstcIntro webtechstc
Intro webtechstc
 
HTML 5 Simple Tutorial Part 1
HTML 5 Simple Tutorial Part 1HTML 5 Simple Tutorial Part 1
HTML 5 Simple Tutorial Part 1
 
html for beginners
html for beginnershtml for beginners
html for beginners
 
HTML Foundations, pt 2
HTML Foundations, pt 2HTML Foundations, pt 2
HTML Foundations, pt 2
 
HTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts Basics
 
The complete-html-cheat-sheet
The complete-html-cheat-sheetThe complete-html-cheat-sheet
The complete-html-cheat-sheet
 

Viewers also liked

Ppt export
Ppt exportPpt export
Ppt exportwihrbt
 
Export management
Export managementExport management
Export managementgomathisugitha
 
Export management
Export managementExport management
Export managementsuresh kumar
 
Project cost & control
Project cost & controlProject cost & control
Project cost & controlAMARAYYA
 
Export & import strategy14
Export & import strategy14Export & import strategy14
Export & import strategy14suresh kumar
 
Export management ppt
Export management pptExport management ppt
Export management pptAMARAYYA
 

Viewers also liked (7)

Ppt export
Ppt exportPpt export
Ppt export
 
Export management
Export managementExport management
Export management
 
Export management
Export managementExport management
Export management
 
Export management ppt
Export management pptExport management ppt
Export management ppt
 
Project cost & control
Project cost & controlProject cost & control
Project cost & control
 
Export & import strategy14
Export & import strategy14Export & import strategy14
Export & import strategy14
 
Export management ppt
Export management pptExport management ppt
Export management ppt
 

Similar to Html xhtml tag-sheet

Html xhtml tag-sheet
Html xhtml tag-sheetHtml xhtml tag-sheet
Html xhtml tag-sheetDaniel Downs
 
introduction to html.ppt
introduction to html.pptintroduction to html.ppt
introduction to html.pptShubhamIngale28
 
Html Workshop
Html WorkshopHtml Workshop
Html Workshopvardanyan99
 
HTML Foundations, part 1
HTML Foundations, part 1HTML Foundations, part 1
HTML Foundations, part 1Shawn Calvert
 
Class Intro / HTML Basics
Class Intro / HTML BasicsClass Intro / HTML Basics
Class Intro / HTML BasicsShawn Calvert
 
intro-to-html
intro-to-htmlintro-to-html
intro-to-htmlVivek Shah
 
introdution-to-htmlppt.ppt
introdution-to-htmlppt.pptintrodution-to-htmlppt.ppt
introdution-to-htmlppt.pptnavyar41
 
web development.pdf
web development.pdfweb development.pdf
web development.pdfBagHarki
 
Html
HtmlHtml
HtmlNithyaD5
 
Workshop 2 Slides.pptx
Workshop 2 Slides.pptxWorkshop 2 Slides.pptx
Workshop 2 Slides.pptxDaniyalSardar
 
Web fundamental concept and tags
Web fundamental concept and tags Web fundamental concept and tags
Web fundamental concept and tags shameen khan
 
WDIM268 Week 6 (Summer 2010)
WDIM268 Week 6 (Summer 2010)WDIM268 Week 6 (Summer 2010)
WDIM268 Week 6 (Summer 2010)Tyler Sticka
 

Similar to Html xhtml tag-sheet (20)

Html xhtml tag-sheet
Html xhtml tag-sheetHtml xhtml tag-sheet
Html xhtml tag-sheet
 
introduction to html.ppt
introduction to html.pptintroduction to html.ppt
introduction to html.ppt
 
Html xhtml tag-sheet
Html xhtml tag-sheetHtml xhtml tag-sheet
Html xhtml tag-sheet
 
Html Workshop
Html WorkshopHtml Workshop
Html Workshop
 
HTML Foundations, part 1
HTML Foundations, part 1HTML Foundations, part 1
HTML Foundations, part 1
 
HTML Bootcamp
HTML BootcampHTML Bootcamp
HTML Bootcamp
 
Class Intro / HTML Basics
Class Intro / HTML BasicsClass Intro / HTML Basics
Class Intro / HTML Basics
 
intro-to-html
intro-to-htmlintro-to-html
intro-to-html
 
BASIC HTML
BASIC HTMLBASIC HTML
BASIC HTML
 
introdution-to-htmlppt.ppt
introdution-to-htmlppt.pptintrodution-to-htmlppt.ppt
introdution-to-htmlppt.ppt
 
web development.pdf
web development.pdfweb development.pdf
web development.pdf
 
Html presentation
Html presentationHtml presentation
Html presentation
 
Html
HtmlHtml
Html
 
Workshop 2 Slides.pptx
Workshop 2 Slides.pptxWorkshop 2 Slides.pptx
Workshop 2 Slides.pptx
 
Common html
Common htmlCommon html
Common html
 
HTML-INTRO.pptx
HTML-INTRO.pptxHTML-INTRO.pptx
HTML-INTRO.pptx
 
Web fundamental concept and tags
Web fundamental concept and tags Web fundamental concept and tags
Web fundamental concept and tags
 
HTML PPT.pdf
HTML PPT.pdfHTML PPT.pdf
HTML PPT.pdf
 
WDIM268 Week 6 (Summer 2010)
WDIM268 Week 6 (Summer 2010)WDIM268 Week 6 (Summer 2010)
WDIM268 Week 6 (Summer 2010)
 
Html intro
Html introHtml intro
Html intro
 

Recently uploaded

Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 đź’ž Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 đź’ž Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 đź’ž Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 đź’ž Full Nigh...Pooja Nehwal
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Dr. Mazin Mohamed alkathiri
 

Recently uploaded (20)

Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 đź’ž Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 đź’ž Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 đź’ž Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 đź’ž Full Nigh...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 

Html xhtml tag-sheet

  • 1. Interactive Media Center http://library.albany.edu/imc/ HTML & XHTML Tag Quick Reference This reference notes some of the most commonly used HTML and XHTML tags. It is not, nor is it intended to be, a comprehensive list of available tags. Details regarding the proper use of XHTML are at the end of this document. Basic Document Tags What It Is What It Does <html></html> Indicates the start and end of an HTML Document Defines the portion of the document that contains essential formatting information. The <head></head> material in the head is invisible. <body></body> Defines the portion of the document that contains the visible information. Body Attributes Not supported in HTML5. Use Cascading Style Sheets. What It Is What It Does Specifies the background color <body bgcolor=?> Not supported in HTML5. Use Cascading Style Sheets. Specifies the text color <body text=?> Not supported in HTML5. Use Cascading Style Sheets. Specifies the color of unfollowed links. <body link=?> Not supported in HTML5. Use Cascading Style Sheets. Specifies the color of followed links. <body vlink=?> Not supported in HTML5. Use Cascading Style Sheets. Specifies the color of links when they are clicked. <body alink=?> Not supported in HTML5. Use Cascading Style Sheets. NOTE: Body attributes may be combined within the body tag. Example: <body bgcolor="#FFFFFF" text="#000000" link="#0000CC" vlink="#33CC00" alink="#FF0000"> Not supported in HTML5. Use Cascading Style Sheets. Text Tags What It Is What It Does <hl></hl>,<h2></h2>, The heading tags indicate the importance of a heading ranging from the most important, <h3></h3>,<h4></h4>, h1, to the least important, h6. These specifications are intended to denote the <h5></h5>,<h6></h6> importance data below the heading. <tt></tt> Specifies a typewriter or teletype-like text. Creates an emphasis on text that is rendered usually as italics, but sometimes as bold <em></em> depending on the browser. Creates an emphasis on text that is usually rendered as bold, but sometimes as italics <strong></strong> depending on the browser. Specifies the font size from 1 to 7. 1 is the smallest, 7 the largest, and 3 is generally the <font size=?></font> default size. The font tag is not supported in HTML5. Use Cascading Style Sheets. Specifies font color. <font color=?></font> The font tag is not supported in HTML5. Use Cascading Style Sheets. NOTE: Font attributes may be NOTE: The font tag is not supported in HTML5. Use Cascading Style Sheets. combined within the font tag. Example: <font size="4" Roger Lipera 011/12 v5 1 Interactive Media Center rlipera@albany.edu http://library.albany.edu/imc/ This and other free handouts are available on our Web site.
  • 2. Interactive Media Center http://library.albany.edu/imc/ color="#33FF00">Example of combined font attributes. </font> Common Formatting Tags What It Is What It Is What It Does (HTML 4.0 & Earlier) (XHTML & HTML5) <p></p> Same Defines a paragraph. <p align=?> Same Defines paragraph alignment left, right, or center. <br> Same Inserts a line break. Same Defines a block quote and indents text from both <blockquote></blockquote> sides. Usually with some extra space above and below. <ol></ol> Same Defines the beginning and end of an ordered list. <ul></ul> Same Defines the beginning and end of an unordered list. Same Defines the beginning and end of a line within a list. <li></li> Start a line with a number in an ordered list, and with a bullet in an unordered list. Image Tags What It Is (HTML) What It Is (XHTML) What It Does <img src="name"> <img src="name" /> Places and image. Specifies the alignment of an image; left, right, center; <img src="name" align=?> <img src="name" align=? /> bottom, top, middle <img src="name" border=? Specifies a border around and image. <img src="name" border=?> /> <img src”=name” alt=”name” Specifies the alternative label for an image. This is <img src”=name” alt=”name”> /> especially important for use nongraphical browsers. NOTE: Attributes within the img tag may be combined. Example in HTML: <img src="images/fisherman.jpg" width="209" height="214" alt="Our Founder"> Example in XHTML: <img src="images/fisherman.jpg" width="209" height="214" alt="Our Founder" /> Horizontal Rule Tags What It Is (HTML) What It Is (XHTML) What It Does <hr> <hr /> Specifies the start of a horizontal rule. <hr size=?> <hr size=? /> Specifies the height of a horizontal rule. States that the horizontal rule should have no shade. <hr noshade> <hr noshade /> NOTE: Attributes within the horizontal rule tag may be combined. Example in HTML: <hr noshade width="75%" size="4"> Example in XHTML: <hr noshade width="75%" size="4" /> Roger Lipera 011/12 v5 2 Interactive Media Center rlipera@albany.edu http://library.albany.edu/imc/ This and other free handouts are available on our Web site.
  • 3. Interactive Media Center http://library.albany.edu/imc/ Table Tags What It Is What It Does <table></table> Specifies the beginning and end of a table. <tr></tr> Specifies the beginning and end of a table row. <td></td> Specifies the beginning and end of a table cell. <th></th> Defines a table header. A normal cell with text that is bold and centered. <table border=#> Specifies the size of the border around a table and cells within the table. <table cellspacing=#> Specifies the space between cells. <table cellpadding=#> Specifies the amount of space between the border of a cell and the items within the cell. <table width=”?”> Specifies the width of a table in either pixels or percent. <tr align=?> Specifies the alignment of contents in a row of cells as either left, right, or center. <td align=?> Specifies the alignment of contents in a cell as either left, right, or center. <tr valign=?> Specifies the vertical alignment of contents in a row of cells as either top, bottom, or middle. <td valign=?> Specifies the vertical alignment of contents in cell as either top, bottom, or middle. <td colspan=#> Specifies the number of columns a cell will span. <td rowspan=#> Specifies the number of rows a cell will span. <td nowrap> Stops text from automatically line wrapping. XHTML can be thought of as an upgraded and stricter version of HTML 4.01, while HTML 5 is an expansion and clarification of the markup language for the Web. Neither XHTML nor HTML 5 is particularly difficult to write. However, there are some important techniques to writing properly formed code. There are some simple rules that must be followed. The most important rules are: • Tags must all be in lower case. • Elements must be nested correctly. • Tag elements must be closed. • Documents must be well-formed Examples of lower case rule: <STRONG>This is incorrect.</STRONG> <strong>This is correct.</strong> Roger Lipera 011/12 v5 3 Interactive Media Center rlipera@albany.edu http://library.albany.edu/imc/ This and other free handouts are available on our Web site.
  • 4. Interactive Media Center http://library.albany.edu/imc/ Examples of the nesting rule: <strong><em>This is incorrect nesting.</strong><em> <strong><em>This is correct nesting.</em></strong> Examples of the closed tag rule: This horizontal rule tag is not closed- <hr> This horizontal rule tag is closed- <hr /> This image tag is not closed- <img source=”/images/picture.jpg” alt=”Cows in a pasture”> This image tag is properly closed- <img source=”/images/picture.jpg” alt=”Cows in a pasture” /> Examples of the well-formed document rule: XHTML documents must have the proper structure. This means all components must be within the opening and closing HTML tags, <html></html>. Internal elements must be correctly nested and located properly. The basic components and structure of an XHTML document are- <html> <head> </head> <body> </body> </html> Roger Lipera 011/12 v5 4 Interactive Media Center rlipera@albany.edu http://library.albany.edu/imc/ This and other free handouts are available on our Web site.
  • 5. Interactive Media Center http://library.albany.edu/imc/ XHTML/HTML 5 Syntax Rules XHTML and HTML 5 require that some basic rules of syntax be followed. As with the tag rules noted above, XHTML and HTML 5 syntax is not much more difficult that correctly formed HTML 4.0. These rules are, however, much stricter and must not be violated. These rules follow. • Attributes must be quoted. • The Name attribute is replaced by the ID attribute • Attribute shorthand must not be used. • DOCTYPE statement must be used. (The DOCTYPE statement is part of Document Type Definition, DTD, and is used to specify which syntax is used in the Web page.) Examples of the quoted attribute rule: This is incorrect- <table width=75% bgcolor=ff0000> This is correct- <table width-“75” bgcolor=”ff0000”> Examples of the Name attribute replacement rule: This is incorrect- <img src=”/images/cows.jpg” name=”photo12” /> This is the correct substitution- <img src=”/images/cows.jpg” id=”photo12” /> Examples of the no shorthand rule: This is an example of improper shorthand- <input checked> This is the same tag correctly written without shorthand- <input checked=”checked” Examples of DOCTYPE statements: Invalid “old-style” DOCTYPE statement: <html> <head> <title>This is a page without a statement</title> </head> <body> </body> </html> Roger Lipera 011/12 v5 5 Interactive Media Center rlipera@albany.edu http://library.albany.edu/imc/ This and other free handouts are available on our Web site.
  • 6. Interactive Media Center http://library.albany.edu/imc/ XHTML DOCTYPE statement: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Example of a page with a DOCTYPE statement</title> </head> <body> </body> </html> HTML 5 DOCTYPE statement: <!DOCTYPE HTML> <html> <head> <title>Example of a page with a DOCTYPE statement</title> </head> <body> </body> </html> Note that the DOCTYPE statement goes ahead of the opening HTML tag, <html>. The statement is not part of the HTML document and does not have a closing tag. It is used to tell a browser how to render the document. There are three XHTML DOCTYPE statements. Statement used to create clutter-free pages that must follow rules exactly when Cascading Style Sheets are used: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Statement used when HTML presentational features are present and when it is desirable to support older browsers that do not fully understand Cascading Style Sheets: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Roger Lipera 011/12 v5 6 Interactive Media Center rlipera@albany.edu http://library.albany.edu/imc/ This and other free handouts are available on our Web site.
  • 7. Interactive Media Center http://library.albany.edu/imc/ Statement used when frames are incorporated into the design of the page (note that frames are an obsolete design technique and are not used in modern page designs): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> HTML5 has only the one DOCTYPE statement noted above. About HTML 5 At the time of this writing, HTML 5 remains in a non-official state. Many Web page builders are starting to incorporate elements of HTML 5 into their projects. All current browsers support some HTML 5 components, but no browser supports everything outlined in the HTML 5 rules. One primary reason for this is that the HTML 5 rules are being constantly updated as problems are worked out. HTML 5 has many new tags. It is necessary to understand that the purpose of HTML is to specify what something is. For instance, HTML identifies a page element as a link, a list, a paragraph, or some other sort of object. Presentation is controlled by Cascading Style Sheets. In other words, HTML specifies that an object is, for instance, a link, but not what color the link is. HTML 5 expands the list of tags by providing more options for identification. It is now possible to identify headers, footers, sections, audio, video, and much more. The expansion of HTML tags and the ability of browsers to understand these new tags will improve the usability of the World Wide Web and result in new methods of presentation with better results. It also means that we can expect less variation in the appearance and operation of Web pages when viewed with different browsers and operating systems. Roger Lipera 011/12 v5 7 Interactive Media Center rlipera@albany.edu http://library.albany.edu/imc/ This and other free handouts are available on our Web site.