문제

I am working with this Web Page for improving my programming skills:

http://www.studenti.ict.uniba.it/esse3/ListaAppelliOfferta.do

If you take a look at its source code, you can see HTML peculiar tags like

<head> <body> <title>

The question is: I am quite sure this page is not in XML, so is it simple HTML or XHTML?

According to my knowledge those two are quite similar.

How can I tell which of the two it is? If I must choose I'd say simple HTML (5 or 4) but I am not 100% sure!

도움이 되었습니까?

해결책

Look for a Doctype declaration at the very beginning of the document.

If it is XHTML, the doctype will look like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

If it is HTML5, it will look like this:

<!DOCTYPE html>

See the W3 Spec for information on Doctype. More information here at the Mozilla Developer Network, too.

The Website you linked has <!DOCTYPE html> declared, which instructs the browser to interpret the document as HTML5 markup.

다른 팁

The <!DOCTYPE html> declaration indicates that it is HTML5. Of course, it might not actually be HMTL5, but it's claiming that it is. The only way to be sure is to run it through an HTML5 validator.

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