HTML <span> Tag

Example A <span> element used to color a part of a text: <p>My mother has <span style=”color:blue”>blue</span> eyes.</p> Try it Yourself » Definition and Usage The <span> tag is used to group inline-elements in a document. The <span> tag provides no visual change by itself. The <span> tag provides a way to add a hook to a part […]

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

Example Underline a misspelled word with the <u> tag: <p>This is a <u>parragraph</u>.</p> Try it Yourself » Definition and Usage The <u> tag represents some text that should be stylistically different from normal text, such as misspelled words or proper nouns in Chinese. Browser Support Element <u> Yes Yes Yes Yes Yes Tips and Notes Tip: Avoid […]

HTML <div> Tag

Example A section in a document that will have a light blue background color: <div style=”background-color:lightblue”> <h3>This is a heading</h3> <p>This is a paragraph.</p> </div> Try it Yourself » Definition and Usage The <div> tag defines a division or a section in an HTML document. The <div> element is often used as a container for other […]

HTML <data> Tag

Example The following example displays product names but also associates each name with a product number: <ul> <li><data value=”21053″>Cherry Tomato</data></li> <li><data value=”21054″>Beef Tomato</data></li> <li><data value=”21055″>Snack Tomato</data></li> </ul> Try it Yourself » Definition and Usage The <data> tag links the given content with a machine-readable translation. This element provides both a machine-readable value for data processors, and a human-readable […]

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 Layouts

HTML Layout Elements Websites often display content in multiple columns (like a magazine or newspaper). HTML5 offers new semantic elements that define the different parts of a web page: <header> – Defines a header for a document or a section <nav> – Defines a container for navigation links <section> – Defines a section in a […]