Css Position Slides
Css Position Slides
2. When you apply overflow: hidden property to <body> element the property (overflow: hidden) gets applied to <html> element. This is the
default behavior in CSS. If you want to apply overflow: hidden to body somehow, you can define overflow: hidden (auto would also work) to
<html> and manually define overflow: hidden to <body> both.
Positioning Elements
<html>
<body> position:
absolute
<div>
relative
<div> fixed
sticky
Changing the Position
<html>
<body>
top
<div> <div>
viewport
left <div> right
<div>
< <html>
bottom <body>
<div>
<…>
NOTE 1: The top, bottom, left, right and z-index properties can only be applied if the element has position property other than static.
NOTE 2: For inline elements changing the width property has no impact.
NOTE 3: position property can be applied to block-level as well as inline elements.
NOTE 4: If there is a margin that is applied to the parent element then, along with position: fixed, we have to add top: 0 and left: 0 to
move it to the top (as in navigation bar).