HTML5 new features are based on HTML, CSS, DOM, and JavaScript, and reduce the need for external plugins (like Flash).
HTML5 syntax is compatible with both HTML4 and XHTML.
- You can close the single tag elements (META, BR, HR, INPUT, IMG) with a slash, <tag />, like in XHTML; or you can choose to not add the slash, <tag>.
- You can use both lower case, or upper case for the name of the tags and attributes.
So, all the variants bellow are valid HTML5:
<meta charset='utf-8'>
OR, closed with slash:
<meta charset='utf-8' />
<img src='image.jpg' alt='Some text'> OR: <img src='image.jpg' alt='Some text' /> OR, with upper case: <IMG src='image.jpg' ALT='Some text'>
<br> OR: <BR> OR: <br />
<script> // JavaScript code </script>
<style> /* CSS code */ </style>• All these variants are valid in HTML5.
<!doctype html>Meta charset tag is much simpler:
<meta charset='utf-8'>
<!doctype html> <html> <head> <meta charset='utf-8' /> <title>Web Development Courses and Tutorials</title> <meta name='description' content='Example document in HTML5, template, courses and tutorials' /> <meta name='keywords' content='html5, html5 tutorials' /> <link rel='stylesheet' type='text/css' href='style.css' /> </head> <body> <header id='page_header'> <h1>Web Development Courses and Tutorials</h1> <nav> <ul> <li><a href='/' title='Home'>Home</a></li> <li><a href='//marplo.net/' title='Free Courses'>Free Courses</a></li> <li><a href='//marplo.net/forum/'>Forum</a></li> <li><a href='/contact' title='Contact Us'>Contact Us</a></li> </ul> </nav> </header> <section id='posts'> <header id='posts_header'> <h2>HTML5 Tutorials</h2> </header> <article class='post'> <header> <h3>Quick learning Guide</h3> </header> <div class='ctext'> Learn about the new features in HTML5.<br /> New tags, and structure elements. </div> <aside class='post_baner'>Here can be a banner</aside> <p> <em>HTML5</em> new features are based on HTML, CSS, DOM, and JavaScript, and reduce the need for external plugins (like Flash).<br /> A lot of the new features of HTML center around creating a better platform for web-based applications, <a href='https://coursesweb.net/html/html5-quick-tutorial_t' title='HTML5 Quick Tutorial'>Read more</a> ... </p> </article> <article class='post'> <header> <h3>New Form elements and attributes in HTML5</h3> </header> <div class='ctext'> HTML forms are used to pass data to a server, to be processed by a programming language (like PHP, ASP). HTML forms can also be used with script languages, like JavaScript. </div> <p> HTML5 adds a number of new input types for form (datetime, datetime-local, date, month, week, time, number, range, email, url, search, and color), <a href='https://coursesweb.net/html/form-elements-attributes-html5' title='New Form elements'>Read more</a> ... </p> </article> <footer id='post_footer'> <p>See more HTML lessons and tutorials: <a href='https://coursesweb.net/html/' title='HTML Course'>HTML Course</a>.</p> </footer> </section> <section id='sidebar'> <nav> <ul> <li><a href='https://coursesweb.net/html/' title='HTML Course'>HTML Course</a></li> <li><a href='https://coursesweb.net/css/' title='CSS Course'>CSS Course</a></li> <li><a href='https://coursesweb.net/javascript/' title='JavaScript'>JavaScript</a></li> <li><a href='https://coursesweb.net/php-mysql/' title='PHP-MySQL'>PHP-MySQL</a></li> <li><a href='https://coursesweb.net/flash/' title='Flash-ActionScript 3'>Flash-ActionScript 3</a></li> <li><a href='https://marplo.net/jocuri' title='Flash Games'>Flash Games</a></li> </ul> </nav> <aside class='sidebar_baner'>Banner in sidebar</aside> </section> <footer id='page_footer'> <p>From: <a href='https://coursesweb.net/' title='Free Web Development courses'>coursesweb.net</a></p> </footer> </body> </html>
body { width: 99%; margin: 2px auto; font-family: Arial, 'MS Trebuchet', sans-serif; text-align: center; } header, footer, section, aside, nav, article { display: block; } header#page_header { width: 100%; margin: 4px auto; border: 2px solid blue; } header#page_header nav ul { list-style: none; margin: 0; padding: 0; } #page_header nav ul li { display:inline; margin: 0 20px 0 0; padding: 1px; } section#posts { float: right; width: 79%; background-color: #f1f2fe; border: 1px solid yellow; } section#posts header#posts_header { background-color: #abcdef; border: 1px solid green; } article.post { margin:10px; background-color: yellow; text-align: left; } article.post aside { float: right; margin-top: -58px; width: 250px; height: 120px; background-color: #fefefe; } article.post p { clear: right;} section#sidebar { float: left; width: 18%; background-color: #d7d8fe; border: 1px solid green; padding:5px; } section#sidebar nav ul { margin: 3px auto; text-align: left; padding: 0 0 0 15px; } section#sidebar aside { width: 160px; height: 250px; margin: 10px auto; background-color: #fefefe; } footer#page_footer { clear: both; width: 100%; margin: 4px auto; border: 2px solid blue; }
<link rel='stylesheet' type='text/css' href='style.css' />To create web pages with HTML5, you should also know CSS.
First line ...<br> Other line...
#id { letter-spacing: 2px; }
var elm = document.getElementById("theID"); var content = elm.innerHTML; alert(content);
echo "Address URL: http://CoursesWeb.net";