Now that you have a set of terms to use, and understand the basic syntax of HTML Elements and HTML Tags, it's time to start writing your first web site. As you go through the steps of building a web site you will use various HTML Elements, HTML Tags, and HTML Attributes.
Additionally, the activity will reinforce the concepts of file systems, and client-server applications, in that you will upload the HTML documents that you write to the web server's file system so the web server process on can read the files from the file system and serve the files via HTTP across the network.
In this lab, you will create a personal web site which, ultimately, you will share with your classmates. You may wish to consult with this checklist as you go through the lab, but it is only a checklist. These are the instructions! For the first part of this lab, though, the site will only be on your laptop. The sharing will come later. Initially, your website will consist of two files (which should be in a folder C:\Users\m9999\Desktop\www on your laptop, which you'll have to create!):
index.html: This will be the front page of your site. (The name "index.html" has a special meaning, which will be explained later.) The page is an introduction to who you are. Cover the basics of why you came to the Naval Academy and what you hope to service select some day.interests.html: This page should include information pertaining to your interests: sports, academics, clubs, music, etc.C:\Users\m9999\Desktop\www\img. This is where you will put some of the pictures you use on your website.index.html, Index.html, and INDEX.HTML are all different files on the web server.
| HTML File Template |
|---|
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>Title of Web Page</TITLE>
</HEAD>
<BODY>
Content of Web Page: Headings,
Paragraphs, Links, Images, etc.
</BODY>
</HTML>
|
index.html. Do not name your home page any other name. This is the default name for web pages in any directory on a web server. When you go to a URL without a file named at the end, the server looks for a default file, either index.html, index.htm, or default.htm , and displays that automatically, just as if you had typed in that file name in the URL. Every directory should have a default file and, for this lab, your default file name must be index.html.index.html the below sy110 animations. Copy and paste the following into your index.html file in Notepad++ (you can split the animations up or put all three together):
<script type="text/Javascript" src="https://courses.cyber.usna.edu/SY110/calendar.php?key=65da45dd8d4215603d0c0df4e690c49ea6c3c0c8&type=resources&event=22"></script>
<script type="text/Javascript" src="https://courses.cyber.usna.edu/SY110/calendar.php?key=ef85e5663bd19142416072a848a2ac09a68ddbd0&type=resources&event=22"></script>
<script type="text/Javascript" src="https://courses.cyber.usna.edu/SY110/calendar.php?key=d9a0f308b58b49b43f93dc5b61267d3a323e06b3&type=resources&event=22"></script>
<span> element. You can browse to this page and use the auto grading script to determine if your pages contain all of the required elements, or if you are still missing something.
You should go through the process of uploading your index.html file, setting file permissions correctly, and viewing your index.html before you leave class. The URL for your front page is: https:///~{yourUserName}/index.html.
Remember our convention from labs, the {}'s aren't included in the final text!
You now have a basic web page, and enough content to upload to the web server that will host your site.
, which is the same server that is hosting these notes. You'll transfer files using WinSCP, a program may already be on your laptop. If not, it can either be downloaded here: WinSCP-6.5.3-Setup.exe
| 1. Open WinSCP by double clicking on this icon on your Desktop: | 2. Fill in, then click on Save: |
or type WinSCP in the Windows search box. |
|
| 3. Click on OK: | 4. Login: |
. You may even recognize the files and directories there from the Operating Systems lesson when you connected via
ssh to your account.
public_html folder to enter that directory. You may already have an index.html file in this folder. It is only a placeholder, and can be overwritten by with the index.html file from your laptop. All files related to your website must go in this folder!public_html directory already opened). Do NOT select the entire www directory on the left, just the contents of that directory. You are duplicating the contents in the www directory on your computer into the public_html directory on .interests.html - watch your spelling!img within your C:\Users\m9999\www directory. You need to put at least two images in this directory. These are locally stored images, you can use relative paths to reference the location of these files.img tag, which only has a start tag, no end tag). You give a value to the src attribute that is either a URL for the image somewhere on the web, or a relative path to the image starting from the HTML document's [current working] directory on the web server. So for example:
←<img src="https://www.usna.edu/templates/standardv2/images/fb_32.png"><img src="img/larr.png">img directory.width or height attributes, which are placed in the img tag. Use this link for more information. Do not change both width and height for an image, because your image will be distorted or warped.a or anchor element. The structure is like this
<A href="location-of-thing-you're-linking-to">text-that-is-clickable</A>
As with images, link locations given in the href attribute can be relative paths or absolute paths which are URLs. Absolute URLs contain all the parts of a URL, the protocol, the server, and the file system path!
index.html needs to have a relative link to your interests.html page, and your interests.html page needs to have a relative link back to your index.html.href: https:///~m9999/index.html replacing the 9999 with their alpha code.index.html file is like: https:///~m9999/index.html. So, to link to your site someone would do something like this: <a href="https:///~m9999/index.html">MIDN Doe</a>
.
index.html and interests.htmlindex.html to interests.html and a relative path link from interests.html back to index.html.<P>...</P>)<OL>) or an unordered list (<UL>)index.html the three SY110 animations:
<SCRIPT type="text/javascript" src="https://courses.cyber.usna.edu/SY110/calendar.php?key=65da45dd8d4215603d0c0df4e690c49ea6c3c0c8&type=resources&event=22"></SCRIPT>
<SCRIPT type="text/javascript" src="https://courses.cyber.usna.edu/SY110/calendar.php?key=ef85e5663bd19142416072a848a2ac09a68ddbd0&type=resources&event=22"></SCRIPT>
<SCRIPT type="text/javascript" src="https://courses.cyber.usna.edu/SY110/calendar.php?key=d9a0f308b58b49b43f93dc5b61267d3a323e06b3&type=resources&event=22"></SCRIPT>
Have a classmate pull up your site on their computer to verify that everything works OK. Then show your instructor so they can verify that you filled the requirements. Save these files for later in the course!