The Most Secure Cross Browser Testing Platform since 2012

7 HTML Features Available Cross Browser Today

BLOG / BrowseEmAll / Browsers / Cross Browser Testing / Multibrowser / Web Development

7 HTML Features Available Cross Browser Today

As web technologies evolve rapidly, browser support for HTML features is constantly being updated. A browser may have started supporting a particular feature months ago, but it’s uncertain when other browsers will follow. Fortunately, there are several HTML features that work seamlessly across all major browsers today. In this article, we’ll explore seven HTML features you can confidently use in modern web development with full cross-browser support. Let’s dive into these essential features that have become indispensable in today’s web landscape!

Section Elements (Semantic HTML Elements)

In web development, semantic HTML elements are used to make the structure of a page more meaningful and improve accessibility. Elements like <section>, <nav>, <article>, <aside>, <header>, and <footer> divide the content into logical sections, making it easier for both browsers and search engines to understand the page. For example, <header> can contain the top section of a page, while <nav> can be used for navigation links. These elements help create a more readable and organized HTML structure.

<header>Header</header
<nav>Menu</nav> 
<section>
    <article>Content</article
</section>
<footer>Footer</footer

Advanced Input Types

HTML5 introduces a range of advanced input types designed to enhance the user experience in web forms. These new types ensure that users enter data in the correct format and allow browsers to perform validation. For example, the tel type is used for phone numbers, the url type for web addresses, the email type for email addresses, and the number type for numerical values. Additionally, there are more specialized types such as date for selecting dates and color for choosing colors. These input types make data entry in forms more efficient and user-friendly, as browsers assist with entering data in the correct format and provide immediate error messages. As a result, developers experience less workload, and users enjoy a smoother experience.

<form>
  <label for="phone">Phone:</label>
  <input type="tel" id="phone" name="phone" placeholder="Enter your phone number"><br><br>
  
  <label for="website">Website:</label>
  <input type="url" id="website" name="website" placeholder="https://www.example.com"><br><br>
  
  <label for="email">Email:</label>
  <input type="email" id="email" name="email" placeholder="example@example.com"><br><br>
  
  <label for="age">Age:</label>
  <input type="number" id="age" name="age" min="18" max="100"><br><br>
  
  <label for="birthdate">Birthdate:</label>
  <input type="date" id="birthdate" name="birthdate"><br><br>
  
  <label for="color">Choose a color:</label>
  <input type="color" id="color" name="color"><br><br>
  
  <input type="submit" value="Submit">
</form>

Form Validation & Enhancements

HTML5 introduces a range of new features to make form validation processes more efficient and user-friendly. The required attribute indicates that a particular form field must be filled out, while the pattern attribute ensures users input data following a specific pattern. For instance, it is useful when specific formats such as phone numbers or postal codes need to be entered. Additionally, the novalidate attribute disables form validation, which can be useful for developers who want to add custom validation processes. The min and max attributes define valid ranges for numerical data, ensuring that users only input acceptable values. These features enhance the accuracy of form data, display error messages instantly, and provide users with a smoother experience.

<form>
  <label for="email">Email:</label>
  <input type="email" id="email" name="email" required placeholder="example@example.com"><br><br>

  <label for="phone">Phone Number:</label>
  <input type="tel" id="phone" name="phone" pattern="\d{3}[\-]\d{3}[\-]\d{4}" placeholder="123-456-7890" required><br><br>

  <label for="age">Age:</label>
  <input type="number" id="age" name="age" min="18" max="100" required><br><br>

  <label for="date">Birth Date:</label>
  <input type="date" id="date" name="date" required><br><br>

  <input type="submit" value="Submit">
</form>

Enhanced Media Support

Nowadays, delivering video and audio content on websites has become easier than ever. HTML5’s <video> and <audio> tags are widely supported by modern browsers, allowing media playback without the need for additional plugins. Modern video formats like WebM and AV1 provide high quality with smaller file sizes, improving performance and optimizing bandwidth usage. Additionally, browsers now support advanced codecs, enabling more efficient compression and better visual quality. These advancements ensure seamless media playback across different devices, significantly enhancing the user experience.

<video controls width="400">
  <source src="video.webm" type="video/webm">
  <source src="video.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>

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

iFrame Security & Restrictions

The iFrame element is commonly used to embed external content into a webpage, but it requires careful security considerations. To prevent malicious content from harming your site, HTML5 provides security features such as sandbox, allow, and referrerpolicy. The sandbox attribute restricts certain actions within the iFrame, preventing the execution of harmful scripts. The allow attribute grants specific permissions to the iFrame content, enabling controlled access to APIs or functionalities. Meanwhile, referrerpolicy defines how referral information is shared, enhancing user privacy. These measures make iFrame usage more secure, protecting web applications from potential threats.

<iframe src="https://example.com" sandbox="allow-scripts allow-same-origin" 
        allow="geolocation" referrerpolicy="no-referrer">
</iframe>

HTML Content Editing (Editable HTML Content)

HTML offers various features that allow users to edit content directly on a web page. The contenteditable attribute makes a specific element editable when clicked, enabling users to modify text without requiring an additional form field. The inputmode attribute determines the type of virtual keyboard that appears, improving the input experience on mobile devices. For example, it can trigger a numeric keyboard when only numbers are needed. The spellcheck attribute enables spell checking, helping users detect errors in their text input. These features are highly useful for creating more interactive and user-friendly content management systems in web applications.

<div contenteditable="true" spellcheck="true" inputmode="text">
  Edit this text directly on the page.
</div>

Latest HTML Enhancements

HTML is continuously evolving, offering web developers more powerful and flexible features. The newly added and improved HTML features not only enhance performance but also improve the user experience. For example, the <dialog> tag allows for the easy creation of custom modal windows, while the <details> and <summary> tags provide collapsible content, creating user-friendly interfaces. Additionally, native lazy loading enables images and iframe content to be loaded only when needed, optimizing page performance. Furthermore, new input types and form validation enhancements make web forms smarter and more accessible. These innovations ensure that modern web applications are faster, more secure, and more interactive.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Modern HTML Enhancements</title>
</head>
<body>

<!-- <dialog> Example -->
<dialog id="myDialog">
  <p>This is a custom modal window created with the <code>&lt;dialog&gt;</code> tag.</p>
  <button onclick="document.getElementById('myDialog').close()">Close</button>
</dialog>
<button onclick="document.getElementById('myDialog').showModal()">Open Modal</button>

<!-- <details> and <summary> Example -->
<details>
  <summary>Click to reveal more information</summary>
  <p>This content can be shown or hidden using the <code>&lt;details&gt;</code> tag.</p>
</details>

<!-- Native Lazy Loading Example -->
<img src="large-image.jpg" loading="lazy" alt="A large image" width="600" height="400">

</body>
</html>

In today’s web development world, modern HTML features have made it possible to create more accessible, secure, and user-friendly web pages. With the expansion of browser support, many innovations, ranging from semantic HTML elements to advanced form inputs, media support, and security measures, have become standardized. The 7 HTML features we’ve examined in this article not only simplify the process for developers but also enhance the user experience. With the future development of HTML and web standards, we can expect websites to become even more powerful and flexible.