Coder Social home page Coder Social logo

phase-0-css-kitten-lab's Introduction

BONUS: CSS Kitten Wheelbarrow

Learning Goals

  • Position elements absolutely
  • Practice using CSS selectors

Introduction

Oh no! All of our kittens have escaped from the wheelbarrow and we need to get them back in. Help collect all the kittens and put them into the wheelbarrow using CSS selectors and absolute positioning.

Getting Started

Fork and clone this lesson into your local environment. Navigate into its directory in the terminal, then run code . to open the files in Visual Studio Code.

Position Elements Absolutely

There are a few different ways we can use CSS to position elements in our web pages. Absolute positioning means placing the element in its containing element in a certain location that will stay the same no matter where other elements are placed. We can use absolute positioning to specify exactly where in the document layout we want an element to be placed:

absolute positioning diagram

Here's an example of what absolute positioning looks like in CSS:

.parent-element {
  position: relative;
}

.child-element {
  position: absolute;
  top: 50px;
  left: 50px;
}

Note When using position: absolute, the browser calculates the position using top/left from the closest parent element that has a position specified โ€” that's why in the example, we're specifying position: relative for the parent element. Check out the resources on positioning for more info on this if you're interested!

For this lab, we've done the work of calculating the absolute positions and creating CSS rules for a bunch of different kitten image elements. It's your job to use CSS selectors to apply the correct positioning to each of these elements.

To get started with this lab, open the index.html file in the browser. Use the comments in css/place-kitty.css to write the correct selectors to move each kitty into the wheelbarrow.

Conclusion

Nice work getting practice with more CSS selectors, and learning about absolute positioning along the way! Now that you've seen absolute positioning in action, you'll have a better sense of when you might need to use it to build more complex CSS layouts in the future.

Resources

phase-0-css-kitten-lab's People

Contributors

annjohn avatar bal360 avatar cjbrock avatar danielseehausen avatar dependabot[bot] avatar fislabstest avatar gj avatar ihollander avatar jenmyers avatar jlboba avatar jongrover avatar lizbur10 avatar louisasm avatar maxwellbenton avatar pletcher avatar sammarcus avatar sarogers avatar sgharms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phase-0-css-kitten-lab's Issues

Place kitty 4 error

Canvas Link

https://learning.flatironschool.com/courses/5639/assignments/179023?module_item_id=395647

Concern

//putting this in shows an error:

#ball+img {
position: absolute;
z-index: 4;
top: 260px;
left: 455px;
}

//error:

  1. place-kitty.css
    selects the image based on the respective sibling element:
    AssertionError: Make sure you have a CSS selector that selects the image based on the respective sibling element: expected undefined to exist
    at Context. (test/place-kitty.css.test.js:48:26)
    at processImmediate (node:internal/timers:466:21)

Additional Context

No response

Suggested Changes

No response

Not enough information, lessons dont provide too much help

Canvas Link

https://learning.flatironschool.com/courses/5055/assignments/152491?module_item_id=324529

Concern

All the lessons are really hard to follow. The lessons dont explain at all how to code correctly. You provide us only with do this and do that. Wish you could provide us with the right codes but we must decide where to put them. This is only a pre-work we are not suppose to know all, since everyone comes with no IT background. And doing it online and asking help in the Slack doestn help either. I could be sitting for days trying to figure out the problem with one assignment. Sometimes even Google doesnt help. I can only imagine when the actual course starts, how hard its going to be.

Additional Context

No response

Suggested Changes

Provide us with the correct codes, and we figure out where to code them. Not just, or <Select the image that has an attribute value matching "Kitty 5" (using attribute selector)> This is really hard to know because in the lesson prior you didnt really provide us with the right codes. And each lesson should have the right codes on the side. We are suppose to learn not figure out how to do this from the start.

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.