Code Monkey home page Code Monkey logo

css-flex's Introduction

CSS Flexbox Layout

Recreate a very similar file to the images shown below using the directions in Parts 1 & 2.

https://github.com/code-differently/css-flex/blob/main/img/flex-full.jpg

https://github.com/code-differently/css-flex/blob/main/img/flex-tablet.jpg

https://github.com/code-differently/css-flex/blob/main/img/flex-mobile.jpg

Part 1

  • Start with the larger screen and work your way to smaller. Begin with a fresh layout and do not use media queries.
  • Place your nav AFTER the main content.
  • Create a <div class="container"> that encompasses the <body>.
  • Set the header and footer to fill the width of the screen using flex: flex-grow flex-shrink flex-basis; (with values included).
  • Using order: x, display elements visually by ordering header first, then nav, main, sidebar, and finally footer.

Part 2

  • Make nav and aside the same size using the same flex-grow and flex-shrink values.
  • The main content should be larger than nav and aside in normal width (not mobile).
  • When .container is larger than 900px, distribute items evenly. When .container is smaller than 900px, items that don't fit should wrap to the next line.
  • Use a flex-shrink to ensure items are not removed from nav and aside items.
  • Use body as a flex container. The <div class="container"> becomes the child. Set a display-flex to body content to justify-content: center to center the content of the page on large widths, but still fill the width on smaller screens.

css-flex's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.