{"id":3746,"date":"2023-07-18T01:06:00","date_gmt":"2023-07-18T01:06:00","guid":{"rendered":"https:\/\/nmi.cool\/advweb\/?page_id=3746"},"modified":"2025-08-28T23:57:33","modified_gmt":"2025-08-28T23:57:33","slug":"exercise-flexbox","status":"publish","type":"page","link":"https:\/\/nmi.cool\/advweb\/unit-one-html-css\/week-three\/exercise-flexbox\/","title":{"rendered":"Exercise: Flexbox"},"content":{"rendered":"\n<p>Today in class we will explore the use of flexbox by working on exercises from&nbsp;<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn\/CSS\/CSS_layout\/Flexbox\" target=\"_blank\" rel=\"noreferrer noopener\">mozilla.developer.&nbsp;&nbsp;<\/a><\/p>\n\n\n\n<p>Be sure to make a new html file for each exercise.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn\/CSS\/CSS_layout\/Flexbox#Wrapping\" target=\"_blank\" rel=\"noreferrer noopener\">Exercise 1:&nbsp;<strong>Wrapping<\/strong><\/a><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>You should have completed the&nbsp;<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn\/CSS\/CSS_layout\/Flexbox#Introducing_a_simple_example\" target=\"_blank\" rel=\"noreferrer noopener\">Simple Example<\/a>&nbsp;as homework. If not, do so now (we&#8217;ll call it Exercise 0).<\/li>\n\n\n\n<li>Now do the exercise titled&nbsp;<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn_web_development\/Core\/CSS_layout\/Flexbox#Wrapping:~:text=these%20values%20too!-,Wrapping,-One%20issue%20that\" target=\"_blank\" rel=\"noreferrer noopener\">Wrapping<\/a>.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn_web_development\/Core\/CSS_layout\/Flexbox#Flexible_sizing_of_flex_items:~:text=row%20wrap%3B-,Flexible%20sizing%20of%20flex%20items,-Let%27s%20now%20return\" target=\"_blank\" rel=\"noreferrer noopener\">Exercise 2: Flexible Sizing.<\/a><\/h3>\n\n\n\n<p><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn_web_development\/Core\/CSS_layout\/Flexbox#Flexible_sizing_of_flex_items:~:text=row%20wrap%3B-,Flexible%20sizing%20of%20flex%20items,-Let%27s%20now%20return\" target=\"_blank\" rel=\"noreferrer noopener\">Click here to do the exercise.&nbsp;<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Horizontal_and_vertical_alignment\"><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn_web_development\/Core\/CSS_layout\/Flexbox#horizontal_and_vertical_alignment\" target=\"_blank\" rel=\"noreferrer noopener\">Exercise 3: Horizontal and vertical alignment<\/a><\/h3>\n\n\n\n<p><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn_web_development\/Core\/CSS_layout\/Flexbox#horizontal_and_vertical_alignment\" target=\"_blank\" rel=\"noreferrer noopener\">This exercise<\/a>&nbsp;explores just what the title implies: horizontal and vertical alignment of flexbox content. In flexbox, by default, content (in this exercise the content is made up of buttons) is spread along the horizontal axis and &#8216;stretches&#8217;&nbsp; to fill the cross axis (<strong>aka<\/strong>&nbsp;vertical up and down axis).<\/p>\n\n\n\n<p>I found their explanation about vertical stretching to be confusing until I played with the css code a while. A couple of tips.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>To start this exercise, I recommend that you simply add&nbsp;<strong>div {display: flex; }&nbsp;<\/strong>to your CSS instead of the three items that they ask for.&nbsp; Once you add the display:flex property, those buttons should stretch.<\/li>\n\n\n\n<li>Afterward, add the other two properties to further explore alignment.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn_web_development\/Core\/CSS_layout\/Flexbox#Flexible_sizing_of_flex_items:~:text=your%20keyboard%20users!-,Nested%20flex%20boxes,-It%27s%20possible%20to\" target=\"_blank\" rel=\"noreferrer noopener\">Exercise 4: Nested flex boxes<\/a><\/h3>\n\n\n\n<p><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn_web_development\/Core\/CSS_layout\/Flexbox#Flexible_sizing_of_flex_items:~:text=your%20keyboard%20users!-,Nested%20flex%20boxes,-It%27s%20possible%20to\" target=\"_blank\" rel=\"noreferrer noopener\">This exercise<\/a>&nbsp;is basically descriptive and illustrates how to create a more complex layout using flexbox. Essentially, you copy the code, look at the file in your browser and then read about it. Not much of an exercise, but read it, go through the motions and do your best to gain an understanding of how nested flex boxes work.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today in class we will explore the use of flexbox by working on exercises from&nbsp;mozilla.developer.&nbsp;&nbsp; Be sure to make a new html file for each exercise. Exercise 1:&nbsp;Wrapping Exercise 2: Flexible Sizing. Click here to do the exercise.&nbsp; Exercise 3: Horizontal and vertical alignment This exercise&nbsp;explores just what the title implies: horizontal and vertical alignment &hellip; <a href=\"https:\/\/nmi.cool\/advweb\/unit-one-html-css\/week-three\/exercise-flexbox\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Exercise: Flexbox<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3688,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3746","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/pages\/3746","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/comments?post=3746"}],"version-history":[{"count":10,"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/pages\/3746\/revisions"}],"predecessor-version":[{"id":4373,"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/pages\/3746\/revisions\/4373"}],"up":[{"embeddable":true,"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/pages\/3688"}],"wp:attachment":[{"href":"https:\/\/nmi.cool\/advweb\/wp-json\/wp\/v2\/media?parent=3746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}