Sunday, September 17, 2017

Week 3: Positioning


This week we were to discuss the difference between relative and absolute positioning detailing how it works and explaining what a z-index is used for. 

In CSS when we are determining where to place an object on a page, we have to decide how we want the object to behave. 

  • Relative positioning will allow an element to be moved with respect to its original position. 

  • Absolute positioning forces an element to set its position on a page regardless of other elements positioning with regard only to its parent element. 

Both relative and absolute use the top, bottom, left, and right positioning properties to set their position. The largest difference is where the initial position is being set to.
With absolute positioning we can use the z-index to determine whether the element we are setting is set to be on top of other elements or set behind other elements. 


The links below are very useful in explaining and showing how the positioning works:

This link allows you to practice with examples of positioning statements:

No comments:

Post a Comment