문제

Can a <script> tag between <!DOCTYPE html> and <html> be valid?

The reason I ask is I found the code I've described above. Can it be valid under any circumstances?

도움이 되었습니까?

해결책

No. <html> is the root (or document) element of an HTML document; it must be the only root-level element in an HTML document (it cannot have any siblings). Further, HTML can only contain <head> and <body> (specifically one of each), meaning that any other tags (e.g. <script> must be descendants of <head> or <body>.

다른 팁

I don't think so. If you want check. Use this validator: http://validator.w3.org/#validate_by_input+with_options

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top