We will add HTML structure to some generic content to better understand semantic markup. Then, we will style all the HTML tags with CSS to create a typical page design. View the Final Page to see what you will create in lab. Note that the solutions HTML and CSS are compressed (called minification), which makes it very difficult to copy and use the code. Do not copy the solution and try to reverse-engineering the compression. Your code must be formatted with proper spacing and indentation.
csis390/
.csis390
folder for storing your lab work, i.e.,
csis390/labs
.lab1, lab2, ..., lab3
.Download the following files to your own lab1
folder, i.e., csis390/labs/lab1
You will use HTML markup to make the web page look like this: Structure Only
The solution above has all the line breaks and extraneous white space removed, which makes it difficult to use it to cheat. Please to not just copy this code. Your solution should be properly formatted with line breaks and tabs.
Chapter 2 and 3 of the zyBook are a great reference for this part. If you do not yet have the book, Mozilla's HTML element reference is also a good source.
page1.txt
in Notepad++ and immediately save it as page1.html
Appropriately add the following HTML tags:
!DOCTYPE
at the very top so we know its HTMLhtml
to encapsulate or wrap all the text in the file.meta
to use the utf-8 character settitle
so the title is "Website Title"body
to encapsulate or wrap all the content except the title and meta tags.h1
for the main website title "Website Title"h4
for the subheading "Main Menu"ul
and li
to make Page 1, Page 2, ..., Page 5 a bulleted list.a
to make Page 1, Page 2, etc. hyperlinks to page1.html, page2.html, etc.nav
to encapsulate the "Main Menu" and bulleted list as follows:header
to encapsulate the h1
and nav
above.h2
for the main web page title "Web Page Title"main
to encapsulate all the content from the web page title down to the nested list of the 3rd section.img
to insert an image pica-sm.png
below the web page title.
Be sure to include the alt
attribute to describe the image.a
to make the image a hyperlink to a larger version pica-lg.png
section
to encapsulate or wrap the content of the three different sections.
Note that there are three section titles with content below.
Each section title and the contents below it should be encapsulated with a section
tag.h3
for the three section headings "Section Title"p
for the four example paragraphs in the 1st section and the sentence immediate below the 2nd and 3rd sections.table
, thead
, tbody
, tr
, th
and td
to
properly structure the data in the 2nd section.
See Mozilla's table example for help.ul
, ol
and li
to
properly structure the nested list in the 3rd section. See zyBook 2.4 for help with properly nesting lists.footer
to encapsulate the bottom-most footer content.Your web page's body
(the visible content) should have the following tree-like structure when complete:
Note that the body
contains header
, main
and footer
.
And, main
contains h2
, a
and three sections
.
You will use CSS (Cascading Stylesheets) to make the web page look like this: Final Page
The solution above has all the line breaks and extraneous white space removed, which makes it difficult to use it to cheat. Please to not just copy this code. Your solution should be properly formatted with line breaks and tabs.
Chapter 3 and 4 of the zyBook are a great reference for this part. If you do not yet have the book, Mozilla's CSS reference is also a good source.
page1.html
in Notepad++ and add a link to a CSS file by adding
the following line of code directly above the title
tag:
<link rel="stylesheet" type="text/css" href="style.css">
link
tag you just added
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,700" rel="stylesheet">
style.css
page1.html
in Chromestyle.css
and then you will save the file and reload page1.html
in Chrome by pressing the reload button to see the change.Add the following CSS code to style.css
, reload page1.html
to see change, and then read the
notes to better understand the changes:
body
of the page:
body { font-family: 'Roboto', sans-serif; background: linear-gradient(to bottom, #ddddee, #333344); margin: 0px; padding: 0px; }Notes:
body
tag.header
of the page:
header { box-sizing: border-box; width: 100%; position: fixed; top: 0px; background-color: #333399; color: white; margin: 0px; padding: 10px 20px; }Notes:
header
tag to create a typical website header.box-sizing
and width: 100%
makes the header as wide as possible taking up the entire width of the browser window.position: fixed
and top: 0
makes the header stick to the top.nav
of the page:
nav ul { list-style: none; padding: 0px; margin: 0px; } nav li { float: left; margin: 0px; padding: 0px; } nav li a { display: inline-block; border: 1px solid #aaaaee; padding: 10px 20px; margin: 0px 5px; color: #bbbbff; background-color: #333366; text-decoration: none; } nav li a:hover { background-color: #3333dd; color: white; } nav h4 { display: none; }Notes:
nav
area.h1
and nav
of the header:
header h1 { float: left; font-weight: 100; margin: 0px; padding: 0px; } header nav { float: right; }Notes:
main
to make it look like a fixed-width page:
main { width: 600px; margin: 150px auto 0px; padding: 20px; background-color: white; color: #444; box-shadow: 5px 5px 10px #444; border-radius: 20px; font-size: 1.1em; }Notes:
h2
in the main area:
main h2 { font-size: 1.8em; font-weight: 300; color: #000000; text-align: center; margin: -20px -20px 0px; padding: 5px 0; background: linear-gradient(to top, #ddaa00, #ffff00); border-top-right-radius: 15px; border-top-left-radius: 15px; }Notes:
img
in the main area:
main img { position: absolute; top: 60px; left: 10px; z-index: -1; }Notes:
table
in the main area:
main table { border-collapse: collapse; } main td, main th { border: 1px solid black; padding: 5px 10px } main th { background-color: #ff4422; color: white; } main tr:nth-child(even) { background-color: #ffff00; }Notes:
border-collapse
is necessary otherwise adjacent cells (td
and th
) will have a double bordernth-child
allows us to only change the even table rowsmain ul { list-style: square; } main ol { list-style: lower-roman; }Notes:
p
in the main area
main p { text-indent: 20px; text-align: justify; }
footer
footer { text-align: center; color: #ccccff; padding: 20px 0 40px; }
h3
in the main area and make it look very unique by adding at least 5 CSS properties.
Submit, your page1.html
and style.css
file in Blackboard.
In the comment area of Blackboard put your partner's name if appliable.
The deliverable must be submitted in Blackboard by midnight on the day before your next scheduled lab meeting. If you wish to work alone, you can submit the deliverable yourself. However, you are encouraged to work with your partner and you can submit together. When submitting as a lab pair, be sure to include your partner's name in the comment area when you submit via Blackboard.
Outside of lab, you are only permitted to work with your lab partner. Do not share your work with any other student, especially student who do not come to lab.