► The CSS position property allows us to define where element boxes are going to reside on the webpage. This could be relative to their usual starting position, relative to parent element or ancestor elements, or relative to the viewport.
The position property can have one of five main properties:
position: static;
position: relative;
position: absolute;
position: fixed;
position: sticky;
We’ll learn all of these in this video.
In addition, we will look at offset properties, controlling content that overflows its container, element visibility, and z-index which allows us to control how elements stack.
► Timestamps:
0:00 Start
0:53 The position property and the containing block
2:05 Static positioning
2:27 Relative positioning & offset properties
4:45 z-index
6:43 Absolute positioning
12:03 Content Overflow
14:45 Fixed positioning
15:54 Creating a navbar with fixed positioning
18:20 Sticky positioning
19:22 Element visibility
21:06 End
► Get the code:
1st Pen start - https://codepen.io/craigabourne/pen/p...
1st Pen end - https://codepen.io/craigabourne/pen/P...
2nd Pen start - https://codepen.io/craigabourne/pen/K...
2nd Pen end - https://codepen.io/craigabourne/pen/q...
► Useful links:
The position property - https://developer.mozilla.org/en-US/d...
CSS Positioning overview: https://datacadamia.com/web/css/posit...
The containing block - https://developer.mozilla.org/en-US/d...
Document flow - http://onwebdev.blogspot.com/2011/01/...
Z-index - https://css-tricks.com/almanac/proper...
Element visibility - https://developer.mozilla.org/en-US/d...
► This video is part of the CSS for Absolute Beginners playlist: • CSS for Absolute Beginners
► Social Media:
/ craigabourne
/ craigabourne
► Code & Projects:
https://github.com/craigabourne
https://codepen.io/craigabourne
Watch video Mastering CSS Positioning Once and For All online without registration, duration hours minute second in high quality. This video was added by user Craig A. Bourne 04 November 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 9,691 once and liked it 413 people.