From the course: Making Sense of the CSS Box Model
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Position is everything - CSS Tutorial
From the course: Making Sense of the CSS Box Model
Position is everything
- When we first set up a document, whether it be with type or HTML, all the content is placed based on its natural position. That means the boxes are displayed one after the other in the natural flow of the content. In CSS we can change the position of an element in various ways and it all starts with understanding the position property. When an HTML element is added to a document, its default position is static. That means the element will be placed in the normal flow of the content. If we change position to relative, we can use the top, right, bottom, left, and zed-index properties to position the box relative to its original location without changing the overall layout. This is akin to cutting out a word or an image from a document and moving it somewhere else. A hole is left where it used to be and the box may end up overlapping other content. The position of an element is often set to relative, not to move it, but…
Contents
-
-
-
-
-
(Locked)
What is the CSS Box Model?4m 50s
-
(Locked)
Changing the contents within the box2m 28s
-
(Locked)
Understanding the display porperty2m 43s
-
(Locked)
Sidebar: Images are inline elements2m 21s
-
(Locked)
Position is everything3m 4s
-
(Locked)
Floating and clearing content2m 40s
-
(Locked)
Using the clearfix2m 28s
-
(Locked)
Pseudo elements: Making the browser hallucinate2m 49s
-
(Locked)
-
-