Code Monkey home page Code Monkey logo

hell's Introduction

Lay out the Recipe Cards

Lots of websites use "cards" to make browsing more appealing. This recipe site has styled the overview information about some of its recipes to look like cards.

But, the recipes aren't organized well on the page. Your job will be to use layout to make the recipe cards look great.

Instructions

A grid for the cards

  • Make the div with class container a flexbox by setting display to flex.
  • Adjust the flex properties applied to the card and container classes so that the cards show nicely in a flexible grid. Set flex-wrap to wrap so that the cards go onto the next line.

When you open the page in a wider screen, the cards should show side-by-side. When the screen is smaller, it'll show fewer columns.

A max-width for the page

  • On large screens, the content looks too thin. Set a max-width of 900px on the body and the header so that everything fits nicer.
  • Move everything to the center by setting margin: auto on the body and header.

A fixed header

  • Use the position property to make the header stay at the top when scrolling.
  • When you do, it might look weird at first! Give it a background color like #fff to fix this.
  • Now, there's not enough space at the top, so the recipes aren't showing up right. Add margin-top of to the .container to give the header enough space.
  • Set the top to 0 so that the header is not shifted down
  • The position change means the header isn't automatically as wide as it should be. Add width: 90% to the header.

When your work is complete, the site should look like this:

Attribution

Idea, recipe descriptions, and links from https://www.simplyrecipes.com/. Check out their version of cards - it's not all that different from this one!

hell's People

Contributors

princeonyekah avatar

Watchers

 avatar

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.