Exercise: CSS Flexbox and Grid
Objective#
Recreate 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 1#
Steps are to be completed by writing css rulesets in your style.css file.
- Review the index.htmlfile. Take note of the structure of the elements, class and id names.
- Style the bodyto display thewidth, height, margin, and background colorthat you want. Remember that the body encapsulates everything on the webpage so this will affect all elements being displayed.
Exercise 2#
Steps are to be completed by writing css rulesets in your style.css file.
- Create a ruleset in your style.cssfile that selects elements with the classnamegrid
- Create a declaration that changes the display property of gridelements togrid
- Create a declaration that changes the grid-template-columns property of gridelements torepeat(4, 1fr)
- Create a declaration that changes the grid-template-rows property of gridelements torepeat(4, 1fr)
Exercise 3#
Steps are to be completed by writing css rulesets in your style.css file.
- Create a ruleset in your style.cssfile that selects elements with the classnamegrid-items
- Create a declaration that changes the border property of grid-itemselements to0.1rem solid gray
- Create a declaration that changes the font size property of grid-itemselements to2rem
- Create a declaration that changes the background color property of grid-itemselements towhite
Exercise 4#
Steps are to be completed by writing css rulesets in your style.css file.
- Create a ruleset in your style.cssfile 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 5#
Steps are to be completed by writing css rulesets in your style.css file.
- Create a ruleset in your style.cssfile 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 6#
Steps are to be completed by writing css rulesets in your style.css file.
- Create a ruleset in your style.cssfile 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 7#
Steps are to be completed by writing css rulesets in your style.css file.
- Create a ruleset in your style.cssfile 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 8#
Steps are to be completed by writing css rulesets in your style.css file.
- Create a ruleset in your style.cssfile 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 9#
Steps are to be completed by writing css rulesets in your style.css file.
- Create a media query in your style.cssfile that will apply rulesets when the screen size ismin-width: 475px
- Create a ruleset in your media query that selects elements the htmlelement
- Create a declaration that changes the font size property of the htmlelement to16px
Exercise 10#
Post KenKen Exercise
- Fully complete the Flexbox Zombies Learning Game by David Geddes