Coder Social home page Coder Social logo

animal-save-lab-online-web-sp-000's Introduction

Animal Save!

Problem Statement

Four adorable animals are in danger and only we, with our knowledge of media queries, absolute positioning and responsive design techniques, can save them.

Objectives

  1. Practice writing media queries
  2. Practice using absolute positioning
  3. Practice testing responsive design

Introduction

In this lab, we will be creating media queries to place our animals in the browser window. Media queries are CSS rules that conditionally apply styles for different screen sizes. Used with the CSS positioning values, we can style our pages to deliver a consistent experience across devices—and, in this case, make sure that no matter the size of the browser window, our animals stay out of trouble.

Instructions

  1. Open the index.html in the browser to navigate to different animal pages to see which ones you can rescue. Click on any individual animal to see the dangers they face. Once you are looking at a particular animals page, clicking and dragging on the corner of the browser and resizing the window you will see where the animal runs into trouble.
  2. Take advantage of media queries using max-width for desktop down and min-width for mobile up designs. Also utilize positioning: absolute, as well as properties such as top:, left:, right: ,bottom: to set the animals' positioning. You can also use CSS transform: rotate() if you wish to turn the animals. A single media query should be used to solve each page.
  3. Write the media queries necessary in the CSS files for each corresponding animal:
  • For the bear, when sizing the browser from smaller to larger (mobile up), when the screen reaches 1196px stop him from falling off the cliff by setting him to stay 800px from the left side of the screen before he reaches the edge.
  • For the ostrich, starting with the screen larger and dragging it smaller (desktop down) have the ostrich jump upwards 100px closer to the top of the screen to avoid being eaten by the alligator. As the screen gets smaller then he will run on top of Mr. Alligator's back.
  • For the monkey, use a combination of min-width and max-width to set a media query that will allow the monkey to jump up over the Spice Girls from screen size of 406px to 1170px keeping him safe from their affection.
  • For the dolphin, using min-width and max-width help her rotate and jump up through the hoop from screen sizes of 642px to 1090px. Note: you can use transform: rotate() command to accomplish this. Read about the setting for rotate here at Mozilla Developer Network.

There is a finished working copy of this site here.

Resources

Finished Solution Example
Mozilla Developer Network - CSS Transform

Conclusion

With media queries, web developers can make sure content will be displayed how it's meant be seen across a range of devices and screens and provide a consistent, effective user experience.

View Animal Save on Learn.co and start learning to code for free.

animal-save-lab-online-web-sp-000's People

Contributors

annjohn avatar bjacooper avatar cjbrock avatar fislabstest avatar fs-lms-test-bot avatar jongrover avatar loganhasson avatar lostnaustin avatar maxwellbenton avatar pletcher avatar sgharms avatar victhevenot avatar wsaxe avatar

Stargazers

 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.