HTML5 Introduction

What is New in HTML5? The DOCTYPE declaration for HTML5 is very simple: <!DOCTYPE html> The character encoding (charset) declaration is also very simple: <meta charset=”UTF-8″> HTML5 Example: <!DOCTYPE html> <html> <head> <meta charset=”UTF-8″> <title>Title of the document</title> </head><body> Content of the document…… </body></html> Try it Yourself » The default character encoding in HTML5 is UTF-8. New HTML5 Elements […]

HTML <rp> Tag

Example A ruby annotation:www. <ruby> 漢 <rt><rp>(</rp>ㄏㄢˋ<rp>)</rp></rt> </ruby> Try it Yourself » Definition and Usage The <rp> tag can be used to provide parentheses around a ruby text, to be shown by browsers that do not support ruby annotations. Use the <rp> tag together with the <ruby> and the <rt> tags: The <ruby> element consists of one or more characters […]

HTML <rt> Tag

Example A ruby annotation: <ruby> 漢 <rt> ㄏㄢˋ </rt> </ruby> Try it Yourself » Definition and Usage The <rt> tag defines an explanation or pronunciation of characters (for East Asian typography) in a ruby annotation. Use the <rt> tag together with the <ruby> and the <rp> tags: The <ruby> element consists of one or more characters that needs an explanation/pronunciation, and an […]

HTML <ruby> Tag

Example A ruby annotation: <ruby> 漢 <rt> ㄏㄢˋ </rt> </ruby> Try it Yourself » Definition and Usage The <ruby> tag specifies a ruby annotation. A ruby annotation is a small extra text, attached to the main text to indicate the pronunciation or meaning of the corresponding characters. This kind of annotation is often used in Japanese publications. Use […]

HTML <kbd> Tag

Example Format text in a document: <kbd>Keyboard input</kbd> Try it Yourself » Definition and Usage The <kbd> tag is a phrase tag. It defines keyboard input. Tip: This tag is not deprecated, but it is possible to achieve richer effect with CSS. All phrase tags: Tag Description <em> Renders as emphasized text <strong> Defines important text […]

HTML <button> autofocus Attribute

Example A button with autofocus: <button type=”button” autofocus>Click Me!</button> Try it Yourself » Definition and Usage The autofocus attribute is a boolean attribute. When present, it specifies that a button should automatically get focus when the page loads. Browser Support The numbers in the table specify the first browser version that fully supports the attribute. Attribute autofocus […]

HTML <base> Tag

Example Specify a default URL and a default target for all links on a page: <head> <base href=”https://www.schools.com/images/” target=”_blank”> </head><body> <img src=”stickman.gif” width=”24″ height=”39″ alt=”Stickman”> <a href=”https://www.schools.com”>Schools</a> </body> Try it Yourself » Definition and Usage The <base> tag specifies the base URL/target for all relative URLs in a document. There can be at maximum one <base> element in a document, and it […]