GithubHelp home page GithubHelp logo

box-boxer's Introduction

Box-Boxer - A Margin And Padding Exercise

Learning Objectives

After this activity, students should be able to:

  • Explain how margins and padding affect content on the web.
  • Have some familiarity with adding and changing margin and padding rules.

Setup

Fork and clone this repository and open it in VS Code.

Submission

You will submit this project on Canvas with a Pull Request. For an update on how to do this, please see our Guide To Pull Requests.

Goal

Your goal is to make the current page approximately match the following picture:

our goal for each of the five divs

Note that you do not have to match it pixel for pixel. If it looks like a box is about 100 pixels from the side of the page on your screen, then set it to be 100 pixels from the side of the page. Our exact values are not your goal.

Resources

You might want to read about how to center a div horizontally.

You might also want to move some divs closer to each other than the default 30 pixels set in the div rules. You can achieve this by overriding the rule for a specific div, setting it to use negative margins.

This fantastic guide to margins has sections on both centering a div and using negative margins to move things closer together.

Instructions

  • You will strive to approximately match the goal screenshot in the Goal section above.
  • You should achieve this using only margin and padding rules.
  • You should not edit the HTML file.
  • You should not edit the CSS above the warning comments in the CSS file.
  • You should add padding and margin rules below the warning comments, in the CSS blocks for .first, .second, etc.
  • You should center the fifth div. If you change your browser window's width, the div should stay in the middle!

box-boxer's People

Contributors

abbreviatedman avatar tay-chi 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.