Lab 5 - Clicking
In this lab, you will work with flexbox and event listeners.
Categories:
less than a minute
Clicktastic
Flex
- Make an html page with a
style
element in thehead
and ascript
element at the end of thebody
. - Inside the
body
, add 2img
elements (you can use picsum.photos to get the URLs for these images). - style the
body
to have nomargin
- style the
body
to have aheight
of100vh
- style the
body
to be a flex container - style the flex container such that the 2 images are centered vertically
- style the flex container such that the 2 images are aligned to at the
start
, horizontally
JS
- Add an event listener such that when the body of the page is clicked, a new image is added to the page
- Update the event listener such that in addition to the above, clicking the image toggles the direction of the flex container from horizontal to vertical
Last modified August 11, 2024: moved a bunch of things for archival purposes (6652bbe)