Are XHTML close elements valid in HTML5?

I was wondering if I can write closing elements themselves, for example, in XHTML in HTML5, for example, <input type="email">maybe <input type="email" />, and will it still be checked? And is this the right way to encode HTML5 web pages?

+3
source share
3 answers

HTML5 can be encoded as XHTML or as HTML 4. This is flexible.

As for the right path, then preference. I suspect that many web designers in the standards are using XHTML and are likely to continue to code this way.

http://html5.validator.nu/, , doctype, W3C .

+5

. :

<!DOCTYPE html>
<html>
<head><title>Title</title></head>
<body>
  <div>
    <p>
      <div/>
    </p>
  </div>
</body>
</html>

HTML4, HTML5. W3C <div/>:

(/" > ), -void HTML-. .

div , , .

+2

, .

The same applies to citation attributes - I read tutorials that prevent quoting variables from a single word. I would quote them all, at least for consistency (unless you have a popular web application where every byte is valuable).

+1
source

All Articles