HTML <i> Tag

Example <p>He named his car <i>The lightning</i>, because it was very fast.</p> Try it Yourself » Definition and Usage The <i> tag defines a part of text in an alternate voice or mood. The content of the <i> tag is usually displayed in italic. The <i> tag can be used to indicate a technical term, a […]

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 <track> label Attribute

Example A video with two subtitle tracks, both with a label defined: <video width=”320″ height=”240″ controls> <source src=”forrest_gump.mp4″ type=”video/mp4″>  <track src=”subtitles_en.vtt” kind=”subtitles” srclang=”en” label=”English”> <track src=”subtitles_no.vtt” kind=”subtitles” srclang=”no” label=”Norwegian”> </video> Definition and Usage The label attribute specifies the title of the text track. The title of the text track is used by the browser when listing available text tracks. Browser Support The numbers in the table specify the […]

HTML <embed> src Attribute

Example An embedded flash animation: <embed src=”helloworld.swf”> Try it Yourself » Definition and Usage The src attribute specifies the address of the external file to embed. Browser Support Attribute src Yes Yes Yes Yes Yes Differences Between HTML 4.01 and HTML5 The <embed> tag is new in HTML5. Syntax <embed src=”URL“> Attribute Values Value Description URL […]

HTML <dd> Tag

Example A description list, with terms and descriptions: <dl> <dt>Coffee</dt> <dd>Black hot drink</dd> <dt>Milk</dt> <dd>White cold drink</dd> </dl> Try it Yourself » Definition and Usage The <dd> tag is used to describe a term/name in a description list. The <dd> tag is used in conjunction with <dl> (defines a description list) and <dt> (defines terms/names). Inside a <dd> tag […]

HTML <time> Tag

Example How to define a time and a date: <p>We open at <time>10:00</time> every morning.</p> <p>I have a date on <time datetime=”2008-02-14 20:00″>Valentines day</time>.</p> Try it Yourself » Definition and Usage The <time> tag defines a human-readable date/time. This element can also be used to encode dates and times in a machine-readable way so that user agents can offer […]

HTML <b> Tag

Example <p>This is normal text – <b>and this is bold text</b>.</p> Try it Yourself » Definition and Usage The <b> tag specifies bold text. Browser Support Element <b> Yes Yes Yes Yes Yes Differences Between HTML 4.01 and HTML5 NONE. Tips and Notes Note: According to the HTML 5 specification, the <b> tag should be used as […]

HTML DOM Abbreviation Object

Abbreviation Object The Abbreviation object represents an HTML <abbr> element. Access an Abbreviation Object You can access an <abbr> element by using getElementById(): Example var x = document.getElementById(“myAbbr”); Try it Yourself » Create an Abbreviation Object You can create an <abbr> element by using the document.createElement() method: Example var x = document.createElement(“ABBR”); Try it Yourself » Standard […]

HTML <!DOCTYPE> Declaration

Example <!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 <!DOCTYPE> declaration must be the very first thing in your HTML document, before the <html> tag. The <!DOCTYPE> declaration is not an HTML tag; it is an instruction to the web browser […]

HTML <!–…–> Tag

Example An HTML comment: <!–This is a comment. Comments are not displayed in the browser–> <p>This is a paragraph.</p> Try it Yourself » Definition and Usage The comment tag is used to insert comments in the source code. Comments are not displayed in the browsers. You can use comments to explain your code, which can […]

HTML Lists

HTML List Example An Unordered List: Item Item Item Item An Ordered List: First item Second item Third item Fourth item Try it Yourself » Unordered HTML List An unordered list starts with the <ul> tag. Each list item starts with the <li> tag. The list items will be marked with bullets (small black circles) by default: Example <ul> […]

HTML Iframes

An iframe is used to display a web page within a web page. Iframe Syntax An HTML iframe is defined with the <iframe> tag: <iframe src=”URL“></iframe> The src attribute specifies the URL (web address) of the inline frame page. Iframe – Explaination Use the height and width attributes to specify the size of the iframe. The attribute values are specified in pixels by default, […]

HTML Links

Links are found in nearly all web pages. Links allow users to click their way from page to page. HTML Links – Hyperlinks HTML links are hyperlinks. You can click on a link and jump to another document. When you move the mouse over a link, the mouse arrow will turn into a little hand. […]

HTML Comments

Comment tags are used to insert comments in the HTML source code. HTML Comment Tags You can add comments to your HTML source by using the following syntax: <!– Write your comments here –> Notice that there is an exclamation point (!) in the opening tag, but not in the closing tag. Note: Comments are not […]

HTML Headings

Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 HTML Headings Headings are defined with the <h1> to <h6> tags. <h1> defines the most important heading. <h6> defines the least important heading. Example <h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6> Try it Yourself » Note: Browsers automatically add some white space (a margin) before and […]