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.

(Originally posted in 2015. Revised 16 Aug 2022 to reflect the latest HTML validator settings.)
<!DOCTYPE html>
<html lang="en">
<head>
    <!--
    YOUR NAME HERE, date, project name, class, etc.
    -->
    <meta charset='utf-8' />
    <meta name="viewport" content="width=device-width" /> 
    <title>My Web Page</title>
    <style>
    /* styles go here */

    </style>
</head>

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

    <script>
    // scripts will go here

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

Here is the code for a bullet list:
<ul>
    <li>Mission College</li>
    <li>Ohlone College</li>
    <li>Gavilan College</li>
    <li>Cabrillo College</li>
</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