HTTP Status Messages

When a browser requests a service from a web server, an error might occur. This is a list of HTTP status messages that might be returned: 1xx: Information Message: Description: 100 Continue The server has received the request headers, and the client should proceed to send the request body 101 Switching Protocols The requester has […]

HTML5 Server-Sent Events

Server-Sent Events allow a web page to get updates from a server. Server-Sent Events – One Way Messaging A server-sent event is when a web page automatically gets updates from a server. This was also possible before, but the web page would have to ask if any updates were available. With server-sent events, the updates […]

HTML5 Web Workers

A web worker is a JavaScript running in the background, without affecting the performance of the page. What is a Web Worker? When executing scripts in an HTML page, the page becomes unresponsive until the script is finished. A web worker is a JavaScript that runs in the background, independently of other scripts, without affecting […]

HTML5 Web Storage

HTML web storage; better than cookies. What is HTML Web Storage? With web storage, web applications can store data locally within the user’s browser. Before HTML5, application data had to be stored in cookies, included in every server request. Web storage is more secure, and large amounts of data can be stored locally, without affecting […]

HTML5 Drag and Drop

Drag and Drop Drag and drop is a very common feature. It is when you “grab” an object and drag it to a different location. In HTML5, drag and drop is part of the standard: Any element can be draggable. Browser Support The numbers in the table specify the first browser version that fully supports […]

HTML5 Geolocation

Locate the User’s Position The HTML Geolocation API is used to get the geographical position of a user. Since this can compromise privacy, the position is not available unless the user approves it. Note: Geolocation is most accurate for devices with GPS, like iPhone. Browser Support The numbers in the table specify the first browser version […]

HTML YouTube Videos

The easiest way to play videos in HTML, is to use YouTube. Struggling with Video Formats? Earlier in this tutorial, you have seen that you might have to convert your videos to different formats to make them play in all browsers. Converting videos to different formats can be difficult and time-consuming. An easier solution is […]

HTML Multimedia

Multimedia on the web is sound, music, videos, movies, and animations. What is Multimedia? Multimedia comes in many different formats. It can be almost anything you can hear or see. Examples: Images, music, sound, videos, records, films, animations, and more. Web pages often contain multimedia elements of different types and formats. In this chapter you will learn […]

HTML Google Maps

Google Maps allows you to display maps on your web page: A Basic Web Page To demonstrate how to add a Google Map to a web page, we will use a basic HTML page: Example <!DOCTYPE html> <html> <body><h1>My First Google Map</h1><div id=”map”>My map will go here</div></body> <html> Try it Yourself » Set the Map Size Set […]

HTML5 Canvas

The HTML <canvas> element is used to draw graphics on a web page. The graphic to the left is created with <canvas>. It shows four elements: a red rectangle, a gradient rectangle, a multicolor rectangle, and a multicolor text. What is HTML Canvas? The HTML <canvas> element is used to draw graphics, on the fly, via JavaScript. The <canvas> element is only […]

HTML5 Semantic Elements

Semantics is the study of the meanings of words and phrases in a language. Semantic elements = elements with a meaning. What are Semantic Elements? A semantic element clearly describes its meaning to both the browser and the developer. Examples of non-semantic elements: <div> and <span> – Tells nothing about its content. Examples of semantic elements: <form>, <table>, and <article> – Clearly defines its content. Browser Support […]

HTML5 New Elements

New Elements in HTML5 Below is a list of the new HTML5 elements, and a description of what they are used for. New Semantic/Structural Elements HTML5 offers new elements for better document structure: Tag Description <article> Defines an article <aside> Defines content aside from the page content <audio> Defines sound content <bdi> Isolates a part […]

HTML5 Browser Support

You can teach older browsers to handle HTML5 correctly. HTML5 Browser Support HTML5 is supported in all modern browsers. In addition, all browsers, old and new, automatically handle unrecognized elements as inline elements. Because of this, you can “teach” older browsers to handle “unknown” HTML elements. You can even teach IE6 (Windows XP 2001) how […]

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

Not Supported in HTML5 Example An acronym is marked up as follows: Can I get this <acronym title=”as soon as possible”>ASAP</acronym>? Try it Yourself » Definition and Usage The <acronym> tag is not supported in HTML5. Use the <abbr> tag instead. The <acronym> tag defines an acronym. An acronym must spell out another word. For example: NASA, ASAP, GUI. […]

HTML <section> Tag

Example A section in a document, explaining what WWF is: <section> <h1>WWF</h1> <p>The World Wide Fund for Nature (WWF) is….</p> </section> Try it Yourself » Definition and Usage The <section> tag defines sections in a document, such as chapters, headers, footers, or any other sections of the document. Browser Support The numbers in the table […]

HTML <select> Attributes

HTML <select> autofocus Attribute A drop-down list with autofocus: <select autofocus> <option value=”volvo”>Volvo</option> <option value=”saab”>Saab</option> <option value=”opel”>Opel</option> <option value=”audi”>Audi</option> </select> Try it Yourself » Definition and Usage The autofocus attribute is a boolean attribute. When present, it specifies that the drop-down list should automatically get focus when the page loads. HTML <select> disabled Attribute A disabled drop-down list: <select disabled> <option value=”volvo”>Volvo</option> <option value=”saab”>Saab</option> <option value=”mercedes”>Mercedes</option> <option value=”audi”>Audi</option> </select> […]

HTML <small> Tag

Example Define a smaller text: <p>DW Faisalabad</p> <p><small> – the world’s largest web development site.</small></p> Try it Yourself » Definition and Usage The <small> tag defines smaller text (and other side comments). Browser Support Element <small> Yes Yes Yes Yes Yes Differences Between HTML 4.01 and HTML5 NONE.   Related Pages HTML tutorial: HTML Text Formatting […]