Homework Assignments Based on Flexbox / CSS Grid Lab
1) Written HW: HTML & CSS Grid Questions
Instructions: Answer the following 10 questions related to HTML and CSS Grid. This exercise aims to reinforce your understanding of the layout mechanisms.
- What is the role of the
display: grid;
property in CSS? - How do you define rows and columns in a CSS grid layout?
- What is the purpose of
grid-template-areas
? - How can you make a grid item span multiple rows or columns?
- Explain the use of
grid-gap
. - What is the difference between
grid-template-columns
andgrid-auto-columns
? - What does the
justify-items
property do in a grid layout? - How does
align-items
affect grid items? - What is the function of the
grid-area
property? - Describe a scenario where Flexbox is more appropriate to use than CSS Grid.
Instructions
- Go to CodePen and create a new pen.
- Answer the above questions in the html tab
- Create an
ol
- Then create an
li
for each question - Inside each
li
place 2span
tags - In 1
span
tag write the question - In the other
span
tag write the answer - Above the
ol
add ah1
tag and put your name in theh1
- Below the
h1
place anh3
and inside here type the name of your class and the Week this homework was assigned.
2) Practical HW: CSS Grid & Flexbox Layout
Platform: CodeSandbox
Goal: Create a 3x3 layout using CSS Grid, populate squares with X's and O's, and center them using Flexbox.
Instructions:
- Create a new project on CodeSandbox and name it "3x3 Grid Layout".
- Use CSS Grid to create a 3-row by 3-column layout.
- Place X's and O's in the squares.
- Use Flexbox to center the X's and O's within each square.
Tips:
- Utilize
justify-content: center;
andalign-items: center;
for Flexbox centering. - Make use of
grid-template-areas
for easier layout management.
3) Theoretical HW: Easy-Level JavaScript Challenge
Challenge: "The Alphabet Printer"
Goal: Write a JavaScript function that prints each letter of the alphabet on a new line.
Instructions:
- Write a function named
printAlphabet
. - Use a
for
loop to iterate through the values of 'a' to 'z'. - Print each letter on a new line.
- If the letter is a vowel, captalize it.
Key Takeaways:
- These homework assignments are designed to deepen your understanding of HTML, CSS, and JavaScript.
- They build upon the skills you've acquired during the Flexbox/CSS Grid class & lab.
- The theoretical hw builds upon your fizzbuzz solutions, but the way you get the answer will not be a mathematical operation. (the answer is closer than it appears)
- Proper submission ensures that your progress can be tracked and that you receive appropriate feedback.
Hungry For More
eCardly
Learning Objectives
- HTML & CSS
Prerequisites
- HTML & CSS
Deliverables
index.html
and styles.css
files that try to recreate the eCardly mockup as best as you can. The images you'll need are in the /ecardly/images
directory inside this folder.
Tips
Body
-
The
<body>
should have a background of the background.jpg provided for you in the images folder. The image should repeat only going left and right. The rest of the page should have a background of #d6d6d6.- Hint: define the background image repeating in only one direction AND the background color on the same line.
- The
<body>
has a default font of Helvetica with font size of 12px. - Define a line height for the body of 1.7. This gives every line of text .35 padding above and below it.
Links (<a>
tags)
- Links on the page should be red (#ff3300) and not be underlined.