4. Style the
using at least 3 properties. One of these properties must be setting the font to a “web-font”, available on the Google Fonts CDN
5. Style the
This will allow our table to scroll, instead of taking up a ton of vertical space on the page.
6. Add at least 4 style properties to the
element. This will ensure that the top (stationary) row of our table looks distinctive.
7. Add at least 4 style properties to the
element. This will ensure that the cells within our main table have appropriate spacing and are styled to match the rest of the page.
8. Add at least 2 properties to all elements that are used for the description of the pets. These elements will be located inside
element. This will ensure that anytime a element is used in the description of a pet, the text will be highlighted.
9. Lastly, update the academic honesty statement at the top of the file with your name and the current date.
For Part B, we will be creating and a new CSS file to be used in the CanadianPT.html file located within the PartB folder.
When you’re ready to begin editing the files, open the uncompressed folder (Assignment4) and locate the directory “partB”. Open this directory using Visual Studio Code (https://code.visualstudio.com). You may test your html files in any modern browser (Chrome, Firefox, Safari, Internet Explorer, etc).
Please note: when developing your CSS, you must add comments (/* … */) to describe each of the selectors. For example, above the selector “.main-container nav”, include the comment /* Select all
elements that are a child of an element with class “main-container” and adjust it’s size and position */.Getting Started– completed sample 1.png
• locate the “css” directory and add the file “site.css”
• Open the file “canadianPT.html” for editing and add the tag to include your new site.css file
• Open canadianPT.html in a web browser
• Open both “site.css” and “canadianPT.html” for editing/viewing
Step 1 – Styling the main containers – completed sample 2.png
• Notice how the page “canadianPT.html” is broken up into major sections:
…
,
,
…
,
and
• We need to apply styles to these sections, so add the following CSS Selectors (in the file site.css) to your page. For each selector, use the suggested CSS Properties to achieve each design requirement. See the completed sample for reference
CSS Selector
Design Requirement
Suggested CSS Properties
.main-container
• Set the maximum width to 960 pixels
• No top or bottom margins
• Left and right margins must be “auto”
• max-width
• margin
.main-container nav
• Set the width to 30%
• Element is positioned on the left side of the page
• width
• float
.main-container .main
• Set the width to 70%
• Element is Positioned on the right side of the page
• width
• float
.main-container header
• Padding around the content must be 10 pixels
• Background colour must be #eeeeee
• There must be a solid bottom border 1 pixel thick, coloured #cccccc
• Bottom margin must be 30 pixels
• padding
• background-color
• border-bottom
• margin-bottom
.main-container header h1
• Set the width to 70%
• The size of the font must be 24 pixels
• Element is Positioned on the right side
• The text is right-aligned
• Top margin must be 10 pixels
• width
• font-size
• float
• text-align
• margin-top
.main-container footer
• position the element beneath all floating elements (“clear” the element)
• Padding around the top and bottom must be 20 pixels
• Padding around the left and right must be 10 pixels
• Background colour must be #eeeeee
• There must be a solid top border 1 pixel thick, coloured #cccccc
• The size of the font must be 13 pixels
• clear
• padding
• background-color
• border-top
• font-size
Step 2 – Styling the navigation and logo – completed sample 3.png
• Now that the page is looking a little more organized, we want to update the “Canada” logo (flag & name) as well as the side navigation to look a little cleaner. For each selector, use the suggested CSS Properties to achieve each design requirement. See the completed sample for reference
CSS Selector
Design Requirement
Suggested CSS Properties
#logo
• Set the width to 30%
• The size of the font must be 25 pixels
• The font must be bold
• width
• font-size
• font-weight
#logo img
• The image must be 94 pixels wide
• The image must be vertically positioned in the middle, relative to the “Canada” text
• width
• vertical-align
nav ul
• Do not show any bullets or numbers for the list
• list-style-type
nav ul a
• render the link as a “block-level” element
• remove the underline
• Padding around the link must be 5 pixels
• display
• text-decoration
• padding
Step 3 – Styling the province containers – completed sample 4.png and 4-resize.png
• Everything is looking pretty good, but the page is very vertical. For a more modern design, we will render all of the provinces as “cards” and allow them to sit side-by-side horizontally. We also want to allow them to move onto the next line and render correctly if the user decides to resize the browser window. For each selector, use the suggested CSS Properties to achieve each design requirement. See the completed samples for reference
CSS Selector
Design Requirement
Suggested CSS Properties
div.province
• Set the width to 30%
• Each new element is positioned to the right of the previous element, horizontally (hint: float:left)
• The margin around the element must be 8 pixels
• The height of the element must be 310 pixels
• width
• float
• margin
• height
div.province .description
• The element must not be any higher than 165 pixels
• Only If the content goes beyond 165 pixels high, show a scroll bar
• If the content does not fit in the container horizontally, hide the scrollbar
• The top and bottom margins must be 8 pixels
• max-height
• overflow-y
• overflow-x
• margin
div.province a
• render the link as a “block-level” element
• position the text in the middle of the element (horizontally)
• set the colour of the background to #555555
• Set the colour of the text to #eeeeee
• remove the underline
• Padding around the link must be 5 pixels
• display
• text-align
• background-color
• color
• text-decoration
• padding
img.flag
• set the width to be 100% of the parent
• width
• add the following declaration at the top of your site.css file:
/*********************************************************************************
*
* WEB222 – Assignment #4b
*
* I declare that this assignment is my own work in accordance with Seneca
* Academic Policy. No part of this assignment has been copied manually or
* electronically from any other source (including web sites) or distributed to
* other students.
*
* Name: ______________________ Student ID: ______________ Date: ________________
*
********************************************************************************/
Other Requirements
• Each HTML page in Part A & B MUST PASS (no errors) the W3C’s HTML Validation: https://validator.w3.org/
• All CSS used in the assignment MUST PASS (no errors) the W3C CSS Validation: https://jigsaw.w3.org/css-validator
Assignment Submission:
• Zip all of your files (ie, your Assignment4 folder) as Assignment4.zip
• Upload the zip file to My.Seneca under Assignments -> Assignment 4 (same submission procedure as Assignments 1, 2 & 3)
• NOTE: Your HTML must not contain any errors when validated ( https://validator.w3.org/ )
• NOTE: Your CSS must not contain any errors when validated ( https://jigsaw.w3.org/css-validator )
Important Note:
• NO LATE SUBMISSIONS for assignments. Late assignment submissions will not be accepted and will receive a grade of zero (0).
• After the end (11:00PM) of the due date, the assignment submission link on My.Seneca will no longer be available.