REFRESH THIS PAGE
I am currently updating these pages and might have made
minor changes since you last viewed it in your
browser.
Week 4: Basic Elements & Document Structure; Images
In this lesson you'll learn the semantic elements used to create a
standard web document (e.g. header, footer, main content, etc)
and you'll learn some of the basic HTML elements used to create
content such as paragraphs, links, and images. You'll also learn
about valid and well-formed HTML and why this is important, and
how to ensure that all your HTML files containn valid HTML.
Basic HTML Elements & Images
Notes
- Adding Images
- Basic Elements
(we did the first few sections in the previous lesson, so in
this lesson, just the last couple of sections)
Resources
- References:
- Tutorials and Articles:
Document Structure, DOM
Notes
Resources
- References:
- Tutorials and Articles:
- Tools:
Homework
Practice/Study Questions
- Complete
this week's worksheet.
Note that worksheets can be completed during class or after class.
They can be completed using your own lecture notes or from the provided
materials. Worksheets are not directly graded, but the questions might
appear on exams and other evaluations. Ask the professor if you would
like feedback on your worksheet (you must make an attempt on the
worksheet in order to receive feedback).
- Answer the following questions where you take your
class notes (form your answers using YOUR OWN WORDS; you might have
to search for answers in the resources above):
- In what situation would you use the <article> element?
In what situation would you use use the <aside> element?
In what situation would you use the <section> element?
- Why is it important to use the alt="" attribute on
images in your document?
- What is an absolute path? What is a relative path?
Which should you use for images and other files in
a web document and why?
- What is hotlinking? When shouldn't you hotlink and
why?
- What are the <figure> and <figcaption> elements
used for?
Practice Exercises
Note
In the practice exercises, elements are referred to in all-caps, e.g.
FOOTER refers to the <footer></footer>
element (or it could also refer to an opening <footer> tag or closing </footer>
tag, you will know by the context in which it's used).
For each exercise, validate the HTML using the HTML Validator. Fix all
problems until you get no errors.
Note
If you would like to make your pages "pretty", I have created
a very basic stylesheet you can use (and feel free to edit, if you're
feeling adventurous or already know some CSS):
- In your /syst10049 directory, add a sub-directory called
/css
- Download the main.css file by right-clicking the link
and selecting "Save As..." in the context menu. Save
the main.css file to your /syst10049/css directory.
- In any .html file where you want to add the styles, add
the following code inside the document's <head></head>
element:
<link rel="stylesheet" href="../../css/main.css">
This assumes that you're following the file/directory structure
described in each week's exercises and using industry best practices.
(e.g. if your .html is in /week1/exercise1, then ../../ goes back
up to the syst10049 directory, then /css/main.css references the
main.css file inside the /css directory inside /syst10049)
- If you haven't already done so, create a sub-directory in your
local workspace and in your server workspace (off /syst10049)
called "week1". Feel free to add an extra level for all
of your practice exercises (e.g. /exercises).
- For each practice exercise in each lesson, you'll usually
be asked to create an exercise directory for that
project, such as "/exercise1".
- It is assumed that you will create the exercise
project directory in both your local workspace and in
your server workspace using the appropriate and standard
directory structure discussed in class.
- Create a new project directory called /exercise1 in this week's
directory.
Add an index.html page to your exercise1 directory. Add the
minimal HTML and set the title to something that makes sense.
- In the
index page, add the minimal HTML structure. Inside the
BODY element, add a HEADER element that contains a level-1 heading
containing your first and
last name.
- Below the header, add a paragraph element
with 5 sentences
describing why you are taking your current program of
study and what you hope to do after graduation. Feel
free to add more than 5 sentences, if you wish, or multiple
paragraphs. Get creative and feel free to look ahead and use
some of the other elements you're going to learn.
- Add a FOOTER element that contains an ADDRESS element.
The ADDRESS should contain your standard copyright
information, including the © symbol
and your full name.
(to display the
© symbol, use the code © - this is called
a character entity and we'll learn these in a later
lesson)
- Add a paragraph to your page in the previous question.
Inside the paragraph, add a link to one of your favourite
web sites.
- Add an image of yourself or an image that is relevant to you,
to the page in the previous question.
- Create a new project directory called /exercise2 in this week's
directory. Add an index.html page to your project directory.
Add the
minimal HTML and set the title to something that makes sense.
- Add a standard HEADER and FOOTER to your page. Your header
should include a level-1 heading containing "Semantic Example"
and a level-2 heading containing your first and last name.
Your footer should contain your standard copyright.
- Add a MAIN element that contains three ARTICLE elements.
Each ARTICLE should start with a level-2 heading and contain
at least 2 paragraphs of text. Use Lorum Ipsum text for your
headings and paragraphs (use common sense regarding the length
and number of words).
- Choose one ARTICLE and add an ASIDE that contains a paragraph
of Lorum Ipsum text.
- Create a new project directory called /exercise3 in this week's
directory.
Add an index page to your project directory.
Add the
minimal HTML and set the title to something that makes sense.
- Add a standard HEADER and FOOTER to your page.
In your HEADER, add a level-1 heading with the content "Course
Terminology".
Your footer should contain your standard copyright.
- Add a SECTION element that contains a level-2 heading
with the content
"Client/Server". Below the level-2 heading, add a paragraph
with the definition of "client/server" IN YOUR OWN WORDS. Do
not copy/paste from any source or this will count as
plagiarism.
- Add a second SECTION element to the MAIN element:
the level-2 heading contains the content
"Progressive Enhancement". Below the level-2 heading,
add a paragraph
with the definition of "progressive enhancement" IN YOUR OWN WORDS. Do
not copy/paste from any source or this will count as
plagiarism.
- Add a third SECTION that's just like the first two,
but this one defines "HTML".
- Make a reference list of the elements you have learned today:
DOCTYPE, HTML, HEAD, BODY, TITLE, META, P, H1, IMG, and any
others you learned. Explain the purpose of each element.
You'll need this list for your exam reference!
- Create a new project directory called /exercise4 in this week's
directory.
Add an index page to your project directory.
In the index page, add the minimal HTML structure.
Add the
necessary elements to your page to display a portfolio
of your future work and projects, as follows:
- In the HEADER element of your document, add the
following:
- A level-1 heading with your first and last name.
- A level-2 heading with "Online Portfolio".
- Add a SECTION that contains a level-3 heading with the
content "Experience", and then a paragraph summarizing
your experience and education so far (you can imagine
perhaps that you're writing this after you graduate
and embellish a little bit).
- Add a section that contains a level-3 heading with the
content "My Projects". Follow this with a paragraph
containing a list of links to your four (future)
web assignments on your Dev.FAST space (e.g.
http://login.dev.fast.sheridanc.on.ca/syst10049/assign1)
- Make sure you have your standard FOOTER at the bottom of
the document with your
first and last name, and the current date.
- Create a new project directory called /exercise5 in this week's
directory.
Add an index page to your project directory.
In the index page, add the minimal HTML structure.
Your index page shows news for a pet shelter:
- Your header section should contain a level-1 heading with
"Sydney's Shelter News". Your footer should contain a standard
copyright notice with your first and last name and the current
year.
- Add three
articles to your page. Each article should have authors
and dates (you can make these up). Use Lorum Ipsum text
for your article content. Each article should have about
700 words. Article 2 contains an ASIDE with 250 words.
- A client wants a web page for their jewelry-making
business. Create a new project directory called /exercise6
in this week's directory.
Add an index page to the project directory. Add 3 more pages
to the project directory: contact.html, about.html, and catalog.html.
The index page should contain a HEADER section and FOOTER section.
The header section should contain a level-1 heading with the
content "Arti's Jewelry" and a level-2 heading with the content
"Custom made jewelry by hand". The footer section should contain
a standard copyright notice with your first and last name and the current
year. Add a navigation area to the header with links to the contact,
about, and catalog pages. Between the header and footer, add a MAIN
element. Inside the MAIN, add a SECTION
with a level-3 heading that contains the content "News". Add
3 paragraphs of Lorum Ipsum text below the News heading (about 300
words total). The other 3 pages should have the following content:
- Create a new project directory called /exercise7 in this week's
directory.
Add an index page to your project directory.
In the index page, add the minimal HTML structure.
Add the following to your index page:
- Right-click this image
and select "Save Image As". Save
it into an appropriate location inside your project.
- Use Google Image Search of a
food or beverage
that you like. To find an
image you're allowed to use/modify (after performing your search,
select Settings under the search bar and select "Advanced Search".
Near the bottom, look for the "Usage Rights" field and select any
"use or share" option.) Download the image and store it in an
appropriate location inside your /exercise7 directory.
- Add the necessary elements to your page to display information about
your favourite food or beverage:
- In the HEADER element of your document, add the
following:
- A level-1 heading with your first and last name.
- A level-2 heading with "My Favourite Foods/Beverages".
- Add your standard FOOTER with your name and copyright info.
- In between the header and footer of your page, add an ARTICLE
with a level-3 heading containing the name of your chosen
food or beverage.
- Below the level-3 heading, add a couple of paragraphs about
your chosen food/beverage. You can describe it, why you
like it, how it's made, talk about its ingredients, etc.
- Add the picture you downloaded as an example of the food
or beverage you're desribing. This is a sample of your
chosen item, so should you use a <figure>?