First Look at HTML5

[vc_row][vc_column][vc_custom_heading text=”HTML5 Doctype declaration ” use_theme_fonts=”yes”][vc_column_text]Remember the DOCTYPE declaration from XHTML?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
In HTML5, there is just one possible DOCTYPE declaration and it is simpler:
 <!DOCTYPE html>
Just 15 characters!
The DOCTYPE tells the browser which type and version of document to expect. This should be the last time the DOCTYPE is ever changed. From now on, all future versions of HTML will use this same simplified declaration.

[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_custom_heading text=”TheElement ” use_theme_fonts=”yes”][vc_column_text]This is what the <html> element looked like in XHTML:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Again, HTML5 simplifies this line:
<html lang="en">
The lang attribute in the <html> element declares which language the page content is in. Though not strictly required, it should always be specified, as it can assist search engines and screen readers.

Each of the world’s major languages has a two-character code, e.g. Spanish = “es”, French = “fr”, German = “de”, Chinese = “zh”, Arabic = “ar”.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_custom_heading text=”TheSection ” use_theme_fonts=”yes”][vc_column_text]Here is a typical XHTML <head> section:

<head> 

 <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />

 <title>My First XHTML Page</title> 

 <link rel="stylesheet" type="text/css" href="style.css" />

</head>
And the HTML5 version:

<head> 

 <meta charset="utf-8"> 

 <title>My First HTML5 Page</title> 

 <link rel="stylesheet" href="style.css"> 

</head>

Notice the simplified character set declaration, the shorter CSS stylesheet link text, and the removal of the trailing slashes for these two lines.[/vc_column_text][/vc_column][/vc_row]

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *

Available for work