Home > Web Front-end > HTML Tutorial > HTML5 browser support

HTML5 browser support

(*-*)浩
Release: 2019-10-23 15:47:35
Original
2422 people have browsed it

You can help older browsers process HTML5.

HTML5 browser support

HTML5 Browser Support

All modern browsers support HTML5. (Recommended learning: html tutorial)

In addition, all browsers, old and new, will automatically treat unrecognized elements as inline elements.

Because of this, you can help older browsers handle "unknown" HTML elements.

Note: You can even teach Stone Age IE6 how to handle unknown HTML elements.

Defining HTML5 elements as block-level elements

HTML5 defines eight new semantic HTML elements. All are block-level elements.

You can set the CSS display property to block to ensure correct behavior in older browsers:

Example

header, section, footer, aside, nav, main, article, figure {
    display: block; 
}
Copy after login

Ask HTML Adding New Elements

You can add any new element to HTML via browser tricks:

This example adds a new element named to HTML, and Define the display style for it:

Instance

<!DOCTYPE html>
<html>
<head>
  <title>Creating an HTML Element</title>
  <script>document.createElement("myHero")</script>
  <style>
  myHero {
    display: block;
    background-color: #ddd;
    padding: 50px;
    font-size: 30px;
  } 
  </style> 
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
<myHero>My First Hero</myHero>
</body>
</html>
Copy after login

The above is the detailed content of HTML5 browser support. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template