Exercise: CSS Flexbox and Grid
#
ObjectiveRecreate the 4x4 KenKen Board below using the HTML elements given in the index.html file for this exercise. In the end, the KenKen board with resemble the picture, and users with have the ability to put number answers into each square. The board will also be responsive to all screen sizes.
#
Exercise 1Steps are to be completed by writing css rulesets in your style.css
file.
- Review the
index.html
file. Take note of the structure of the elements, class and id names. - Style the
body
to display thewidth, height, margin, and background color
that you want. Remember that the body encapsulates everything on the webpage so this will affect all elements being displayed.
#
Exercise 2Steps are to be completed by writing css rulesets in your style.css
file.
- Create a ruleset in your
style.css
file that selects elements with the classnamegrid
- Create a declaration that changes the display property of
grid
elements togrid
- Create a declaration that changes the grid-template-columns property of
grid
elements torepeat(4, 1fr)
- Create a declaration that changes the grid-template-rows property of
grid
elements torepeat(4, 1fr)
#
Exercise 3Steps are to be completed by writing css rulesets in your style.css
file.
- Create a ruleset in your
style.css
file that selects elements with the classnamegrid-items
- Create a declaration that changes the border property of
grid-items
elements to0.1rem solid gray
- Create a declaration that changes the font size property of
grid-items
elements to2rem
- Create a declaration that changes the background color property of
grid-items
elements towhite
#
Exercise 4Steps are to be completed by writing css rulesets in your style.css
file.
- Create a ruleset in your
style.css
file that selects elements with the following ids:box3, box7, box10, box11, box12, box15
- Create a declaration that changes the border left property of the selected elements to
0.5rem solid black
#
Exercise 5Steps are to be completed by writing css rulesets in your style.css
file.
- Create a ruleset in your
style.css
file that selects elements with the following ids:box1, box2, box3, box4, box5, box8, box9, box10, box11
- Create a declaration that changes the border bottom property of the selected elements to
0.5rem solid black
#
Exercise 6Steps are to be completed by writing css rulesets in your style.css
file.
- Create a ruleset in your
style.css
file that selects elements with the classnameprompt
- Create a declaration that changes the position property of the selected elements to
absolute
- Create a declaration that changes the top property of the selected elements to
0%
- Create a declaration that changes the left property of the selected elements to
0%
#
Exercise 7Steps are to be completed by writing css rulesets in your style.css
file.
- Create a ruleset in your
style.css
file that selects elements with the classnameanswer
- Create a declaration that changes the width property of the selected elements to
50%
- Create a declaration that changes the height property of the selected elements to
50%
- Create a declaration that changes the text align property of the selected elements to
center
#
Exercise 8Steps are to be completed by writing css rulesets in your style.css
file.
- Create a ruleset in your
style.css
file that selects elements with the classnamespecial
- Create a declaration that changes the border property of the selected elements to
none
- Create a declaration that changes the font size property of the selected elements to
2rem
#
Exercise 9Steps are to be completed by writing css rulesets in your style.css
file.
- Create a media query in your
style.css
file that will apply rulesets when the screen size ismin-width: 475px
- Create a ruleset in your media query that selects elements the
html
element - Create a declaration that changes the font size property of the
html
element to16px
#
Exercise 10Post KenKen Exercise
- Fully complete the Flexbox Zombies Learning Game by David Geddes