Sample: Assignment 6 Edit An HTML Document
Sample: Assignment 6 Edit An HTML Document
Sample: Assignment 6 Edit An HTML Document
E
Open the HTML5 folder.
Right click the index file. From the menu, click Open with. Choose a browser.
Right click the index file. From the menu, click Open with. Choose Notepad or another
HTML Text Editor. document provided in the TechnoHTML
Resource folder. TIP: If Notepad is not in the
list, select Choose Another
App. Select More Apps,
and then choose
Notepad. Click OK.
Use the taskbar to toggle back and forth between the browser and HTML Text Editor.
E
<body>
<h1>Learning How to Build a Web Page</h1>
<img src="htmlfaces.gif" alt="html brackets">
<p>You are going to learn how to build a web page.</p>
<p>When you are learning how to build a web page it takes time. It is often difficult to have patience, as you
want to get started typing right away. It is a good idea to first learn about HTML tags. This will make it easier for you
when you make your own web page.</p>
<hr>
The body has <h2>Parts of an HTML Document</h2>
<p>An HTML document is divided into parts. The head has information about the web page. The body has the
the text, pictures, words, pictures, and links.</p>
page.</p>
PL
<h2>Getting Started</h2>
<p>In this assignment, you are going to learn how to add text including headings and paragraphs. You will also
edit code to insert pictures and hyperlinks. When you are finished you should have a better understanding of HTML
code.</p>
<p>There are many free sites that can help you build your website.</p>
A web page is divided into parts. The <head> </head> tells the web
browser information about the web page. Edit the title in the head.
SA
<head>
<title>About HTML</title>
</head>
Now look at the taskbar. Notice the browser button reads About HTML which is the page
title. Click About HTML.
Now look in the web browser window. Notice that the page tab reads About HTML.
Change the title from About HTML to: <title> Editing a Web Page </title>
Click Refresh or press F5 on the keyboard to reload the web page with the changes.
E
PL
Look at the taskbar button. It has also changed. Toggle back to the index.html
document. You should be looking at the source code.
There are six heading tags: <h1> <h2> <h3> <h4> <h5> <h6>.
Each has a different font size, with h1 being the largest and h6
being the smallest.
o Add text to the main heading: <h1>Learning How to Build a Web Page is Fun</h1>
o Add a new subheading:
▪ Look half way down the document.
▪ Position the cursor before the paragraph
<p>There are many free sites that can help you build your website.</p>
Press ENTER.
▪ In the blank space, type <h2>Helpful Websites</h2>
E
The tags <p> and </p> are used to create paragraphs. Most tags are
written in pairs with opening and closing tags (with a few exceptions).
Add your own paragraph using HTML.
o
Press ENTER. PL
Add your name to the HTML document:
Near the top of the page, position the cursor at the end of the </h1> tag.
o Position the cursor at the end of the sentence When you are learning how to
build a web page it takes time. Press ENTER.
o Type <br>
You can add a line or horizontal rule <hr> to the web page.
This is used to divide the content into themes or topics. Similar
to the line break <br> it does not have a closing tag.
E
Press ENTER.
o In the blank space, type <hr>.
Replace a Picture
PL
You can add images to a web page. You must know the picture
name and picture type to write the code. As well, the picture
should be placed in the same location as the index.html file.
IMG SRC stands for image htmlfaces.gif is the filename ALT stands for alternate. The
source. An image is any of the picture. Notice the code places alternate text
picture on the web page. name of the picture is one onto the web page while
SA
There are several pictures in the Sample File folder where the
index.html file is located. Replace htmlfaces with htmlcomputer.
E
Save the changes and view them in the browser.
professional, consistent
There are several design
ways to set the style of afor
web page using CSS:
• External File: You can create an external file and link to it. This method is ideal if you have
their web pages.
more than one web page in your website, as all web pages can reference the same
style sheet.
• Head: You can put the style information in the head of the html file. This method is best if
you have only one web page or you have unique styles for a web page in your site.
E
When you are learning it can be easier if all source code is in one place. For this reason,
you will use this method to make your web page.
• Body: You can put the style information in the body. This method should only be used
when you want to change the appearance of a single item on the web page. You will
explore how to use this method in this activity.
PL
To build a web page you need to understand how to set the design of HTML tags. To prepare for
this task, you are going to edit CSS in a web page. Instructions explain how to adjust the style of
the body, headings, paragraph, horizontal rule, and images.
You are now going to open the index file in Notepad or another
HTML Text Editor. This program will let you edit the code.
Right click the index file. From the menu, click Open with. Choose Notepad or another
HTML Text Editor.
E
color: blue;
text-align: left; padding: 5px;
} }
p { font-family: arial;
font-size: 100%;
color: black;
text-align: left;
line-height: 100%;
The h1 style tells the web browser how to
hr {
}
width: 400px;
show the heading 1 <h1> tag. In this
color: green;
example, all h1 headings will be written using
img {
table {
td {
}
}
</style>
PL
background-color: green;
height: 5px;
}
padding: 5px;
}
float: left;
font-family: arial;
font-size: 100%;
color: black;
text-align: left;
padding: 5px;
View the web page. Read the first four paragraphs about CSS.
a Verdana font, have a normal font size of
100%, and will appear red, centered, with
5 pixels of space around the letters.
M
Set the Color of an Element using Words
body { background-color: white;
width: 800px;
margin: auto;
You can set the color of the background or text. You }
SA
h2 { font-family: georgia;
font-size: 100%;
Save the changes. color: orange;
text-align: left;
}
Toggle to the browser and refresh the page to view
p{ font-family: arial; font-size:
100%;
Heading 1 or h1 is olive.
E
color: brown;
text-align: left;
All horizontal rules or line-height: 100%;
}
hr are coral.
hr { width: 400px;
All Heading 2 or h2 color: coral;
background-color: coral;
are orange.
All paragraphs or p
h1 { font-family: verdana;
Set the Color of an Element using Hex Codes font-size: 100%;
SA
color: #03406A;
text-align: center; padding:
If you want to use specific shades of color, you will 5px;
need to type in a hex code. It looks like this #8BB381. }
Following pages have been
Save the document and view the changes in the browser.
color: #A101A6;
background-color: #A101A6;
height: 5px;
Padding creates
space around an
element.
E
Edit CSS
and provide extra challenges.
Explore CSS:
PL
Delete the body style margin: auto;
What happens to the web page when this code is removed?
The web page is no longer centered on the screen and is aligned to the left.
Re-add the body style margin: auto;
M
CSS Challenge:
If you need inspiration there are three sample web pages in the Web Pages folder. They were
created using the assignments and extension activities in this project.
E
Web Page Planner
Use this Web Page Planner to keep track of the resources you have collected about your topic.
Topic:
Information:
•
•
•
PL
Write down three interesting facts about your topic.
•
•
•
Websites:
Find three excellent websites about your topic. Write down the URL in the space below.
• http://
• http://
• http://
You will need three pictures for your web page. Below are
instructions on how to save pictures from the Internet. You will
place all your pictures into an HTML folder. Be sure to save the
pictures as one word, with no capitals or spaces.
E
limitations on use. These are often called royalty-free.
Copyrighted pictures posted online may have a copyright © symbol on the image with the date
or name of the owner. This is a way of identifying who took the picture. If you want to use a
copyrighted picture to complete your school work, in most cases you can. However, when you
insert the picture into your work you should not remove the copyright symbol.
PL
Most search engine can filter images to quickly find those that you can use by license or usage
rights. Before saving a picture check to make sure you can use it in your school work.
Click Save.
E
</html>
students to practice their coding skills.
3. Add the title Avalanches to the head using <title> </title>
4.
5. PL
Add the heading Natural Disasters and Avalanches to the body using <h1> </h1>
You do not want to save over top of your web page. For this reason, you are going to save
your work into a new folder called avalanches AND to be EXTRA SAFE you are going to call
the file index2.html (instead of index.html).
a. IMPORTANT! Create a subfolder called avalanches.
b. Inside the avalanches folder save the file as index2.html.
SA
</style>
E
font-size: 220%;
color: #055C64;
}
11. Use your skills to format the style of the paragraph. Set at least two attributes.
12.
13.
font-family
color
PL
font-size
line-height
E
3. Right click the index.html file. Select Open with – choose a browser.
4. Right click the index.html file. Select Open with – Notepad or another HTML Text Editor.
5.
PL
Type the open tag <ul> before the list of player names.
Type the close tag </ul> after the list of player names.
<ul>
<li>Mickey Mantle</li>
<li>Babe Ruth</li>
M
<li>Willie Mays</li>
<li>Yogi Berra</li>
<li>Jim Thorpe</li>
<li>Lou Gehrig</li>
<li>Sammy Sosa</li>
<li>Derek Jeter</li>
SA
</ul>