HTML <html> Tag

Example A simple HTML5 document: <!DOCTYPE HTML> <html> <head> <title>Title of the document</title> </head><body> The content of the document…… </body></html> Try it Yourself » Definition and Usage The <html> tag tells the browser that this is an HTML document. The <html> tag represents the root of an HTML document. The <html> tag is the container for […]

HTML <hr> width Attribute

Example A horizontal line with a width of 50%: <hr width=”50%”> Try it Yourself » Definition and Usage The width attribute specifies the width of a horizontal line, in pixels or percent. Browser Support Attribute width Yes Yes Yes Yes Yes The width attribute is deprecated, but still supported in all major browsers. Compatibility Notes The […]

HTML <hr> size Attribute

Example A horizontal line with a height of 30 pixels: <hr size=”30″> Try it Yourself » Definition and Usage The size attribute specifies the height of a horizontal line, in pixels. Browser Support Attribute size Yes Yes Yes Yes Yes The size attribute is deprecated, but still supported in all major browsers. Compatibility Notes The size […]

HTML <hr> noshade Attribute

Example A noshaded horizontal line: <hr noshade> Try it Yourself » Definition and Usage The noshade attribute is a boolean attribute. When present, it specifies that a horizontal line should render in one solid color (noshaded), instead of a shaded color. Browser Support Attribute noshade Yes Yes Yes Yes Yes The noshade attribute is deprecated, but […]

HTML <hr> align Attribute

Example A left-aligned horizontal line: <hr align=”left” width=”50%”> Try it Yourself » Definition and Usage The align attribute specifies the alignment of a horizontal line. Note: The align attribute has no effect unless the width attribute is set to less than 100%. Browser Support Attribute align Yes Yes Yes Yes Yes The align attribute is deprecated, but still […]

HTML <hr> Tag

Example Use the <hr> tag to define a thematic change in the content: <h1>HTML</h1> <p>HTML is a language for describing web pages…..</p><hr> <h1>CSS</h1> <p>CSS defines how to display HTML elements…..</p> Try it Yourself » Definition and Usage The <hr> tag defines a thematic break in an HTML page (e.g. a shift of topic). The <hr> […]

HTML <header> Tag

Example A header for an <article>: <article> <header> <h1>Most important heading here</h1> <h3>Less important heading here</h3> <p>Some additional information here</p> </header> <p>Lorem Ipsum dolor set amet….</p> </article> Try it Yourself » Definition and Usage The <header> element represents a container for introductory content or a set of navigational links. A <header> element typically contains: one […]

HTML DOM Head Object

Head Object The Head object represents an HTML <head> element. Access a Head Object You can access a <head> element by using getElementsByTagName(): var x = document.getElementsByTagName(“HEAD”)[0]; Create a Head Object You can create a <head> element by using the document.createElement() method: var x = document.createElement(“HEAD”); Standard Properties and Events The Anchor object also supports the standard properties and events.

HTML <style> Tag

Example Use of the <style> element in an HTML document: <html> <head> <style> h1 {color:red;} p {color:blue;} </style> </head> <body><h1>A heading</h1> <p>A paragraph.</p></body> </html> Try it Yourself » Definition and Usage The <style> tag is used to define style information for an HTML document. Inside the <style> element you specify how HTML elements should render in a […]

HTML <link> Tag

Example Link to an external style sheet: <head> <link rel=”stylesheet” type=”text/css” href=”theme.css”> </head> Try it Yourself » Definition and Usage The <link> tag defines a link between a document and an external resource. The <link> tag is used to link to external style sheets. Browser Support When used for style sheets, the <link> tag is supported in all […]

HTML <meta> Tag

Example Describe metadata within an HTML document: <head> <meta charset=”UTF-8″> <meta name=”description” content=”Free Web tutorials”> <meta name=”keywords” content=”HTML,CSS,XML,JavaScript”> <meta name=”author” content=”John Doe”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> </head> Try it Yourself » Definition and Usage Metadata is data (information) about data. The <meta> tag provides metadata about the HTML document. Metadata will not be displayed on the page, but will be machine parsable. Meta elements […]

HTML <script> Tag

Example Write “Hello JavaScript!” with JavaScript: <script> document.getElementById(“demo”).innerHTML = “Hello JavaScript!”; </script> Try it Yourself » Definition and Usage The <script> tag is used to define a client-side script (JavaScript). The <script> element either contains scripting statements, or it points to an external script file through the src attribute. Common uses for JavaScript are image manipulation, form […]

HTML <tfoot> valign Attribute

Example Vertical align the content inside the <tfoot> element to the bottom: <table> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> <tfoot valign=”bottom”> <tr> <td>Sum</td> <td>$180</td> </tr> </tfoot> </table> Try it Yourself » Definition and Usage The valign attribute specifies the vertical alignment of the content in a <tfoot> element. Browser Support […]

HTML <tfoot> char Attribute

Example Align the content inside the <tfoot> element to the “.” character: <table> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> <tfoot align=”char” char=”.”> <tr> <td>Sum</td> <td>$180.00</td> </tr> </tfoot> </table> Try it Yourself » Definition and Usage The <tfoot> char attribute is not supported in HTML5. The char attribute specifies the alignment of […]

HTML <tfoot> charoff Attribute

Example Align the content inside the <tfoot> element two characters to the right from the “.” character: <table> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> <tfoot align=”char” char=”.” charoff=”2″> <tr> <td>Sum</td> <td>$180.00</td> </tr> </tfoot> </table> Try it Yourself » Definition and Usage The <tfoot> charoff attribute is not supported in HTML5. The charoff […]

HTML <tfoot> align Attribute

Example Center-align the content inside the <tfoot> element: <table> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> <tfoot align=”center”> <tr> <td>Sum</td> <td>$180</td> </tr> </tfoot> </table> Try it Yourself » Definition and Usage The align attribute specifies the horizontal alignment of the content inside the <tfoot> element. Browser Support Attribute align Yes Yes […]

HTML <frame> frameborder Attribute

Example A two-framed page, with no frameborders: <frameset cols=”50%,50%”> <frame src=”frame_a.htm” frameborder=”0″> <frame src=”frame_b.htm” frameborder=”0″> </frameset> Try it Yourself » Definition and Usage The <frame> tag is not supported in HTML5. The frameborder attribute specifies whether or not to display a border around a frame. Tip: For practical reasons, it may be better not to specify borders, and use CSS to […]

HTML <frame> Tag

Not Supported in HTML5 Example A simple three-framed page: <frameset cols=”25%,50%,25%”> <frame src=”frame_a.htm”> <frame src=”frame_b.htm”> </frameset> Try it Yourself » More “Try it Yourself” examples below. Definition and Usage The <frame> tag is not supported in HTML5. The <frame> tag defines one particular window (frame) within a <frameset>. Each <frame> in a <frameset> can have different attributes, such […]

HTML <frame> src Attribute

Example The src attribute specifies the location of the document to show in a <frame>: <frameset cols=”50%,50%”> <frame src=”frame_a.htm”> <frame src=”frame_b.htm”> </frameset> Try it Yourself » Definition and Usage The <frame> tag is not supported in HTML5. The src attribute specifies the URL of the document to show in a frame. Browser Support Attribute src Yes Yes Yes […]

HTML <frame> name Attribute

Example A named frame: <frameset cols=”50%,50%”> <frame src=”frame_a.htm” name=”frame_a”> <frame src=”frame_b.htm”> </frameset> Try it Yourself » Definition and Usage The <frame> tag is not supported in HTML5. The name attribute specifies the name of a <frame> element. The name attribute is used to reference the element in a JavaScript, or to act as a target for a link. Browser […]