HTML Geolocation API

The HTML Geolocation API is used to locate a user’s position.

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.

Continue reading HTML Geolocation API

HTML Audio

The HTML <audio> element is used to play an audio file on a web page.


The HTML <audio> Element

To play an audio file in HTML, use the <audio> element:

Example

<audio controls>
  <source src="horse.ogg" type="audio/ogg">
  <source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

Continue reading HTML Audio

HTML Video

The HTML <video> element is used to show a video on a web page.

The HTML <video> Element

To show a video in HTML, use the <video> element:

Example

<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>

Continue reading HTML Video

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, like images, music, sound, videos, records, films, animations, and more.

Web pages often contain multimedia elements of different types and formats.

Browser Support

The first web browsers had support for text only, limited to a single font in a single color.

Later came browsers with support for colors, fonts, images, and multimedia!


Multimedia Formats

Multimedia elements (like audio or video) are stored in media files.

The most common way to discover the type of a file, is to look at the file extension.

Multimedia files have formats and different extensions like: .wav, .mp3, .mp4, .mpg, .wmv, and .avi. Continue reading HTML Multimedia

HTML SVG

SVG (Scalable Vector Graphics)

SVG defines vector-based graphics in XML, which can be directly embedded in HTML pages.

SVG graphics are scalable, and do not lose any quality if they are zoomed or resized:

SVG is supported by all major browsers.

What is SVG?

  • SVG stands for Scalable Vector Graphics
  • SVG is used to define vector-based graphics for the Web
  • SVG defines graphics in XML format
  • Each element and attribute in SVG files can be animated
  • SVG is a W3C recommendation
  • SVG integrates with other standards, such as CSS, DOM, XSL and JavaScript

The <svg> Element

The HTML <svg> element is a container for SVG graphics.

SVG has several methods for drawing paths, rectangles, circles, polygons, text, and much more.

Continue reading HTML SVG

HTML Graphics

What is HTML Canvas?

The HTML <canvas> element is used to draw graphics, on the fly, via JavaScript.

The <canvas> element is only a container for graphics. You must use JavaScript to actually draw the graphics.

Canvas has several methods for drawing paths, boxes, circles, text, and adding images.

Canvas is supported by all major browsers.

Continue reading HTML Graphics

HTML Forms

An HTML form is used to collect user input. The user input is most often sent to a server for processing.

See the Pen
HTML Forms
by Iampsp.com (@iampsp)
on CodePen.


Continue reading HTML Forms

HTML VS XHTML

XHTML is a stricter, more XML-based version of HTML.

What is XHTML?

  • XHTML stands for EXtensible HyperText Markup Language
  • XHTML is a stricter, more XML-based version of HTML
  • XHTML is HTML defined as an XML application
  • XHTML is supported by all major browsers

Why XHTML?

XML is a markup language where all documents must be marked up correctly (be “well-formed”).

XHTML was developed to make HTML more extensible and flexible to work with other data formats (such as XML). In addition, browsers ignore errors in HTML pages, and try to display the website even if it has some errors in the markup. So XHTML comes with a much stricter error handling.

Continue reading HTML VS XHTML

HTML Uniform Resource Locators

A URL is another word for a web address.

A URL can be composed of words (e.g. iampsp.com), or an Internet Protocol (IP) address (e.g. 192.68.20.50).

Most people enter the name when surfing, because names are easier to remember than numbers.

URL – Uniform Resource Locator

Web browsers request pages from web servers by using a URL.

A Uniform Resource Locator (URL) is used to address a document (or other data) on the web.

A web address like https://iampsp.com/blog/ follows these syntax rules :

scheme://prefix.domain:port/path/filename

Continue reading HTML Uniform Resource Locators

HTML Encoding

To display an HTML page correctly, a web browser must know which character set to use.

The HTML charset Attribute

The character set is specified in the <meta> tag:

<meta charset="UTF-8">

Continue reading HTML Encoding