HTML <figure> Tag

Example Use a <figure> element to mark up a photo in a document: <figure> <img src=”img_pulpit.jpg” alt=”The Pulpit Rock” width=”304″ height=”228″> </figure> Try it Yourself » Definition and Usage The <figure> tag specifies self-contained content, like illustrations, diagrams, photos, code listings, etc. While the content of the <figure> element is related to the main flow, its position is independent […]

HTML <th> valign Attribute

Example Vertical align the content inside <th> elements: <table> <tr> <th valign=”bottom”>Month</th> <th valign=”bottom”>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> Try it Yourself » Definition and Usage The valign attribute specifies the vertical alignment of the content in a header cell. Browser Support Attribute valign Yes Yes Yes Yes Yes Compatibility Notes The valign attribute of <th> […]

HTML <th> width Attribute

Example Header cells with a predefined width: <table> <tr> <th width=”70%”>Month</th> <th width=”30%”>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » Definition and Usage The width attribute specifies the width of a table header cell. Normally, a cell takes up the space it needs to display the content. The width attribute […]

HTML <th> height Attribute

Example Two header cells with a predefined height: <table> <tr> <th height=”100″>Month</th> <th height=”100″>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » Definition and Usage The height attribute specifies the height of a header cell. If no height attribute is set, a header cell takes up the space it needs to […]

HTML <th> abbr Attribute

Example Use of the abbr attribute in an HTML table: <table> <tr> <th abbr=”Make”>Toy manufacturer</th> <th abbr=”Model”>Vehicle model</th> </tr> <tr> <td>Bruder Toys</td> <td>Cross Country Vehicle</td> </tr> <tr> <td>Bruder Toys</td> <td>DHL Lorry</td> </tr> </table> Try it Yourself » Definition and Usage The abbr attribute specifies a shorter version of the content in a header cell. Browser Support Attribute […]

HTML <title> Tag

Example Define a title for your HTML document: <!DOCTYPE html> <html><head> <title>HTML Reference</title> </head> <body> The content of the document…… </body> </html> Try it Yourself » Definition and Usage The <title> tag is required in all HTML documents and it defines the title of the document. The <title> element: defines a title in the browser toolbar […]

HTML <th> Tag

Example A simple HTML table with two header cells and two data cells: <table> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> Try it Yourself » More “Try it Yourself” examples below. Definition and Usage The <th> tag defines a header cell in an HTML table. An HTML table has two kinds of cells: […]

HTML <map> Tag

Example An image-map, with clickable areas: <img src=”planets.gif” width=”145″ height=”126″ alt=”Planets” usemap=”#planetmap”> <map name=”planetmap”> <area shape=”rect” coords=”0,0,82,126″ href=”sun.htm” alt=”Sun”> <area shape=”circle” coords=”90,58,3″ href=”mercur.htm” alt=”Mercury”> <area shape=”circle” coords=”124,58,8″ href=”venus.htm” alt=”Venus”> </map> Try it Yourself » Definition and Usage The <map> tag is used to define a client-side image-map. An image-map is an image with clickable areas. The required name attribute of the <map> element is associated with the <img>’s usemap attribute and creates a […]

HTML Form

This section will teach you the basics of HTML forms in detail. HTML Forms HTML Forms HTML Form Elements HTML Input Types HTML Input Attributes

HTML <a> shape Attribute

Example Use of the shape and coords attribute in an <a> element, to create an image-map: <object data=”planets.gif” alt=”Planets” type=”image/gif” usemap=”#Map1″> <map name=”Map1″> <a href=”sun.htm” shape=”rect” coords=”0,0,82,126″>The Sun</a> <a href=”mercur.htm”shape=”circle” coords=”90,58,3″>Mercury</a> <a href=”venus.htm” shape=”circle” coords=”124,58,8″>Venus</a> </map> </object> Try it Yourself » Definition and Usage The <a> shape attribute is not supported in HTML5. The shape attribute is used together with the coords attribute to specify the size, shape, and placement […]