Академический Документы
Профессиональный Документы
Культура Документы
Example:
Websites: File Structure
Step 2: Organizing your Files
Before creating a lot of XHTML files…
It’s a good idea to figure out where to put them (organize first)!
First, you need a Root Directory (top folder).
The XHTML file for your homepage will go here…
Next, divide this folder up into sub-folders:
To reflect the planned organization of the site.
Create a sub-folder for each
section of your site…
To hold related XHTML
files.
With sub-folders to hold
images…
Here is an example:
(*) Note: At the APU site, your
root directory will always be:
‘public_html’…(not ‘website’)
Specifying your Homepage
To specify an XHTML file as your Homepage…
Save the file as: index.html
Then, place it in the top folder of your web directory:
In the website folder, in the example.
Security Tip:
If a visitor enters a web directory folder that does not contain
a default page…
A file called ‘index.html’
He will instead be shown a list of all the folder’s files.
This allows visitors to ‘map out’ a site (dangerous).
To avoid this, place an empty default page in each non-top
folder of your site.
Then, the empty page will show, instead of a list.
Posting Your Website at APU
To post your website for public viewing…
You must upload your files to the APU-Net WWW server.
All students already have space on the server for this.
This is done via FTP, using the ‘FTP Explorer’ program.
Follow the instructions in the APU-Net Guide:
Chapter 9: Student Web Pages (pp. 117-119).
Accessing Your Website
After Uploading your files…
your Website will be available on the internet.
The address of your homepage will be:
http://www.apu.ac.jp/~user_id/
You can access your website in two ways:
Via a Web Browser (e.g., directly, using Netscape);
Just enter your URL in the Location Bar.
Through the Campus Terminal:
Just click the APU Directory menu item (shown):
Followed by Student, etc.
Part II – XHTML Basics (2)
Inserting Images on a Page
Of course, Web pages include Images, as well as text. So…
Images are included using the img element:
<img src=“image.jpg”
height=“val” width=“val”
alt=“Alternative Text”
/>
Note that the img element tag does not surround any text context …
i.e., text to effect;
Such elements are called ‘empty elements’.
Note that they are still terminated with a />.
Elements such as p, whose tags surround text are called: ‘non-empty’.
We will see more simple formatting along the way (next lecture)…
For now, let’s see all of these at work via an Example…
Example: Simple Formatting (1)
Lists
Now, let’s talk more about organizing information within a page…
Basic structures for organization include:
Tables and Lists
First, we will talk about lists.
Lists are used to group information (often hierarchically).
Lists come in two “flavors”:
Unordered
List elements are bulleted, not numbered or lettered…
May imply equal priority or simultaneity among elements.
Example 1:
Element
Element
Ordered
List elements are either numbered or lettered…
May imply decreasing priority, or a time-ordering among elements.
Example:
1. First Element
2. Second Element
Unordered Lists
An unordered list is created by the ul element:
In this type of list, each item begins with the bullet symbol;
e.g., a ‘disc’ (), etc.
List elements are then added using the li element.
List elements may be text, links,
Most browsers render list elements:
With a line break,
And a bullet symbol indented from the beginning of a new line.
Example 1 (unordered list with 2 elements):
<ul>
<li> list element 1 </li>
<li> list element 2 </li>
</ul>
Unordered Lists (Example)
Ordered and Nested Lists
An ordered list is created by the ol element:
In this type of list, each item begins with a number;
List elements will then be displayed hierarchically.
List elements are again added using the li element.
List elements are displayed indented, after a line-break…
Lists may be nested:
i.e., lists may be placed inside of other lists…
List ‘levels’ are distinguished by indenting…
The elements of successively-nested lists will receive an additional indents.
As in the current power-point slide…
This line is in a set of nested un-ordered lists, at level 4.
In unordered nested lists,
List levels are also distinguished by different bullets
For instance, levels 2 and 4 of this list have ‘ ’ and ‘’ bullets, respectively
In ordered nested lists,
List levels are also distinguished by different numbering schemes.
Example: 1, 2, 3, … vs. A, B, C… etc.