07. CSS Positioning πŸ‘©β€πŸŽ“πŸ‘¨β€πŸŽ“

Positioning

Work with a partner to implement the following user story:

  • As a developer, I want to use the CSS position property to change the layout of my page.

Instructions

Fix the given code so that:

  • box 2 is positioned in the middle of square 1 using relative positioning.
  • box 2 is positioned outside of the upper-right corner of square 2 using absolute positioning.

Your solution must match the following image:

Box 2 is positioned in the center of Square 1, while in Square 2, Box 2 is positioned outside the square.

πŸ’‘ Hints

How does the CSS position property change the document’s normal flow?

πŸ† Bonus

If you have completed this activity, work through the following challenge with your partner to further your knowledge:

  • What is the z-index property?

Use Google or another search engine to research this.


βœ… Solutions

Solutions Click Here