Thursday, October 1, 2015

HTML code template

Here is a template for the minimal complete HTML page. If your page doesn't have all these elements, you should edit your page to include all of them. When you start a new page, you can copy and paste this code to get started.
<!DOCTYPE html>
<html>
<head>
    <!--
    YOUR NAME HERE, date, project name, class, etc.
    -->
    <meta charset='utf-8' />
    <title>My Web Page</title>
    <style type='text/css'>
    /* styles go here */

    </style>
</head>

<body>
    <h1>My Web Page</h1>
    <!-- page content will go here -->

    <script type='text/javascript'>
    // scripts will go here

    </script>
</body>
</html>

Add this line in the <head> section if you use responsive design:
    <meta name="viewport" content="width=device-width"/> 

Here is the code for a bullet list:
<ul>
    <li>Mission College
    <li>Ohlone College
    <li>Gavilan College
    <li>Cabrillo College
</ul>

Here is the code for a table:
<table>
    <tr>
        <th>Key</th>
        <th>Command</th>
    </tr>
    <tr>
        <td>Cmd-Space</td>
        <td>Spotlight</td>
    </tr>
    <tr>
        <td>Cmd-S</td>
        <td>Save</td>
    </tr>
</table>

Here is an excellent tutorial on HTML tables (thank you to the student who linked this to your page):

http://www.w3schools.com/html/html_tables.asp


No comments:

Post a Comment