Posted 11 years ago · Author
This is just a bare outline of code which is needed to start a web page. To make a webpage, start by opening up note pad and copying the following code. At the bare minimum, you need head and body elements nested inside of and html element. The html element is the root element of HTML, meaning that it needs to surround all other elements. If you do not know what elements are, then read my XML tutorial: viewtopic.php?f=105&t=7077

Bare minimum code:
Code
<html>
<head>

</head>
<body>

</body>
</html>


If you want your code to be HTML5 strict valid, then you need all of the following code. This allows you to use validators which will catch bugs in your code for you. Go ahead and replace all of your previous code with the following HTML5 Strict Valid Code. If you do not have a validator, then here is the free validator that I use: http://validator.w3.org/

HTML5 Strict Valid Code:
Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
   <meta name="description" content="Write your page descritpion for google here."/>
   <meta name="keywords" content="Place kerwords divided by commas here."/>
    <title>Write Page Title Here</title>
  </head>
  <body>

  </body>
</html>


Now, go ahead and save your code in note pad and give the file a name ending in ".html" instead of the normal ".txt". Afterwards, drag the file into your internet browser (ex: IE, Fx, Crm, etc..). This should give you a blank page.

Now, let's add a bit of page content. Replace the previous code with the following code.

HTML5 Strict Valid Code With Content:
Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
   <meta name="description" content="Write your page descritpion for google here."/>
   <meta name="keywords" content="Place kerwords divided by commas here."/>
    <title>Write Page Title Here</title>
  </head>
  <body>
   <h1>Place Page Title Here</h1>
   <div class="content">
      Place your page content here.
   </div>
  </body>
</html>


Save the file and refresh the page in your browser. You should now see a title and a bit of content on your page. Congrats, you just made your first webpage. Go ahead and keep this code on your computer for further use.