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 <noscript> Tag

Example Use of the <noscript> tag: <script> document.write(“Hello World!”) </script> <noscript>Your browser does not support JavaScript!</noscript> Try it Yourself » Definition and Usage The <noscript> tag defines an alternate content for users that have disabled scripts in their browser or have a browser that doesn’t support script. The <noscript> element can be used in both […]

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 DOM Heading Object

Heading Object The Heading object represents an HTML heading element: <h1> to <h6>. Access a Heading Object You can access a heading element by using getElementById(): Example var x = document.getElementById(“myHeading”); Try it Yourself » Create a Heading Object You can create a heading element by using the document.createElement() method: Example var x = document.createElement(“H1”); Try it […]

HTML <frameset> Tag

Not Supported in HTML5 Example A simple three-framed page: <frameset cols=”25%,*,25%”> <frame src=”frame_a.htm”> <frame src=”frame_b.htm”> <frame src=”frame_c.htm”> </frameset> Try it Yourself » More “Try it Yourself” examples below. Definition and Usage The <frameset> tag is not supported in HTML5. The <frameset> tag defines a frameset. The <frameset> element holds one or more <frame> elements. Each <frame> element can hold a separate […]

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 […]

HTML <frame> scrolling Attribute

Example Frame A should always have scrollbars: <frameset cols=”50%,50%”> <frame src=”frame_a.htm” scrolling=”yes”> <frame src=”frame_b.htm”> </frameset> Try it Yourself » Definition and Usage The <frame> tag is not supported in HTML5. The scrolling attribute specifies whether or not to display scrollbars in a <frame>. By default, scrollbars appear in a <frame> if the content is larger than the <frame>. Browser […]

HTML <frame> noresize Attribute

Example Frame A cannot be resized: <frameset cols=”50%,50%”> <frame src=”frame_a.htm” noresize=”noresize”> <frame src=”frame_b.htm”> </frameset> Try it Yourself » Definition and Usage The <frame> tag is not supported in HTML5. The noresize attribute specifies that a <frame> element cannot be resized by the user. By default, each <frame> in a <frameset> can be resized by dragging the border between the […]

HTML <frame> marginwidth Attribute

Example The first frame with a left and right margin of 50 pixels, and the second frame with a left and right margin of 0 pixels: <frameset cols=”50%,50%”> <frame src=”frame_a.htm” marginwidth=”50″> <frame src=”frame_b.htm” marginwidth=”0″> </frameset> Try it Yourself » Definition and Usage The <frame> tag is not supported in HTML5. The marginwidth attribute specifies the width between the content and […]

HTML <frame> longdesc Attribute

Example The longdesc attribute points to a page with a long description of the content of a frame: <frameset cols=”50%,50%”> <frame src=”frame_a.htm” longdesc=”dw.txt”> <frame src=”frame_b.htm”> </frameset> Try it Yourself » Definition and Usage The <frame> tag is not supported in HTML5. The longdesc attribute specifies a URL to a page that contains a long description of the content of […]

HTML <frame> marginheight Attribute

Example The first frame with a top and bottom margin of 50 pixels, and the second frame with a top and bottom margin of 0 pixels: <frameset cols=”50%,50%”> <frame src=”frame_a.htm” marginheight=”50″> <frame src=”frame_b.htm” marginheight=”0″> </frameset> Try it Yourself » Definition and Usage The <frame> tag is not supported in HTML5. The marginheight attribute specifies the height between the content and […]