Webpage Guide

From UCB Math Wiki
Revision as of 02:06, 26 September 2006 by Mgsa (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page provides a basic tutorial on how to create your own webpage on the math department server. Before proceeding, please make sure you understand basic file management, especially setting file permissions.

In your home directory, you need to create a directory called public_html . All files and directories for your webpage need to go in this directory, and the directory and all its contents must have their permissions set so that others can read the files and read and execute the directories. Make sure that any content you want on your webpage, like pictures, pdf's, etc., is located in public_html.

Additionally, public_html should have a file called index.html , which will be your homepage, i.e. the first page that pops up when someone visits your website. Once you've created this file (and set its permissions), your website's homepage will have the URL: /~<username>. In general, if you create a webpage called foo.html, it's URL will be /~<username>/foo.html.

Basic HTML

Each individual webpage on your site corresponds to a file of the form name.html . An HTML file just consists of plain text with a couple commands that tell the browser to do something to the display (for example, make the text bold font). Just like in LaTeX, there are some special characters that tell the browser "I am giving you a command"; they are <, > and /. Every command takes the form <command>, and most commands also allow you to turn them off by typing </command>. For example, if you want to turn on bold font, type <b>. When you are done typing the text that you'd like bold, turn off bold font with </b>.

The nice thing about HTML is that it is very forgiving--even if you make a mistake it will try its best to render something in the browser. This makes it easy to see the mistake and usually makes it easy to see how to fix the mistake too. Commands are case-insensitive.

  • <HTML> In principle, every .html file should begin with <HTML> and end with </HTML> to let the browser know that you are going to use HTML commands. But if you plan on just writing plain text, then this is not necessary.
  • <Title> This is the title of the webpage--what appears in the top bar of the browser window. Be sure to turn it off after using it, so that all the text doesn't appear in that one bar!
  • <Body> This delineates the body of the webpage: all the text, images, etc that you want to appear on the page should go in between the Body on and off commands.


Learning More HTML

If you come across a webpage and want to know how they did that, you can try looking at the webpage's source. Most browsers have a View Source option in their menu; this will bring up the HTML page which you can examine.

Also, there are many other HTML tutorials and reference guides. One reference can be found here.