Page 1: Responsive Web Page Tutorial, HTML/CSS Only
Page 2: Page Structure using Flexbox and a Media Query
Page 3: Footer (nested flexboxes)
Page 4: Header (menu/search toggles, transition effects)
Page 5: Sticky Aside
Page 6: Make it Beautiful
Page 7: JavaScript Efficiencies, Breadcrumbs, Cats, Audio and More
Page 8: Embedded Note from Creator and Floating Hearts
Page 9: Move On To, Video Tutorial

Footer: Nested Flexboxes

The footer is easier than the header, so is coded first. This provides additional practice with flexbox and media queries. JavaScript will be used to get automatically-updated ‘last modified’ and copyright dates.

The footer has a logo on the left, with several adjacent links/info, which stack up (vertically) next to the logo on small screens. On wider screens, the links/info are equally-spaced across the width. See the images below.

For small screens:
style for Code Chunk 3

For wider screens:
style for Code Chunk 3

In earlier CSS, we had styled:  header, footer. Separate the footer into its own CSS declaration, keeping only the background-color. Code Chunk 3 (below) replaces the  <footer></footer>  container in Code Chunk 2. I've put in realistic-length links and my actual logo to better see the footer behavior.

CODE CHUNK 3:
<footer>
  <div id="footerLogo">logo</div>
  <div id="footerLinkContainer">
    <div id="footerLastModifiedContainer">
      <div id="footerLastModified1">Last Modified:&nbsp;</div>
      <div id="footerLastModified2">month/day/year</div>
    </div>
    <div id="footerCopyrightContainer">
      <div id="footerCopyright1">&copy; year1&ndash;year2&nbsp;</div>
      <div id="footerCopyright2">Dr. Carol JVF Burns</div>
    </div>
    <div id="footerTermsOfUse">Terms of Use</div>
    <div id="footerPoweredByContainer">
      <div id="footerPoweredBy1">Powered By:&nbsp;</div>
      <div id="footerPoweredBy2">MathJax &amp; JSXGraph</div>
    </div>
  </div>
</footer>

Here's the new CSS styling for Code Chunk 3:
style for Code Chunk 3

Major and Minor Axes; Justify versus Align

There are two important axes when working with flexboxes: the main axis and the (perpendicular) cross axis. When distributing extra space between/around flex-items, you must be aware of these axes because different CSS instructions are used for each:

Important: Both  justify-content  and  align-items  control how to distribute extra space. If any flex-item has flex-grow different from 0, then there won't be any extra space; in this case,  justify-content  and  align-items  won't have any effect.

Notes on Code Chunk 3 and its CSS:

JavaScript

JavaScript is a programming language that gives web pages lots of functionality not provided by HTML and CSS.

Last modified date

On a big website like mine (with hundreds of pages), I don't want to hand-code the ‘last modified’ date every time I tweak a page. Instead, put this bit of JavaScript as the contents of the  footerlastModified2  div (in the place of month/day/year):

<script>
    document.write(document.lastModified.
    substring(0,document.lastModified.indexOf(' ')));
</script>

Copyright date range

My footer lists a copyright date range: initial page creation to current year. I certainly don't want to hand-code a new end on hundreds of pages every year.

Put this after the  &ndash;  in  footerCopyright1  (in the place of  year2):

<script>document.write(new Date().getFullYear())</script>




Go on to Page 4 of the Responsive Page Tutorial