[RESOLVED] When declaring the <!DOCTYPE html> for html5 do you need the <html>
I am changing my doctypes to html5
<!DOCTYPE html>
is the <html> tag still necessary ?
Re: When declaring the <!DOCTYPE html> for html5 do you need the <html>
Re: When declaring the <!DOCTYPE html> for html5 do you need the <html>
Re: When declaring the <!DOCTYPE html> for html5 do you need the <html>
Hi there isnoend07,
Actually, the HTML specification explicitly states that the HTML, HEAD and BODY tags are optional. ;)
These options do not apply to XHTML.
Source:-
This example code will validate...
Code:
<!DOCTYPE html>
<meta charset="utf-8">
<title>untitled document</title>
Hello world
Re: [RESOLVED] When declaring the <!DOCTYPE html> for html5 do you need the <html>
Those links are for HTML4.01, not HTML5 ;)
but you're right in that omitting the html, head, and body tags is still allowed by the HTML5 spec. Keep in mind that IE has a bug relating to omitted tags. And you're much less likely to have rendering problems if you don't omit any tags.
Re: [RESOLVED] When declaring the <!DOCTYPE html> for html5 do you need the <html>
Hi there tr333,
Personally, I am still coding HTM4.0.1 strict with the html, head and body
tags included, unless specific HTML5 elements such as video are required. ;)
Re: [RESOLVED] When declaring the <!DOCTYPE html> for html5 do you need the <html>
Quote:
Originally Posted by
coothead
Hi there tr333,
Personally, I am still coding HTM4.0.1 strict with the html, head and body
tags included, unless specific HTML5 elements such as video are required. ;)
Sure, but the original question did ask about HTML5 :)