Monday, October 13, 2014

position: static;

...is a good way to turn off absolute positioning or any other positioning effect that may cause you heartache in a cascading effect. This is the default positioning but I am just now learning about it today as there is normally no reason to explicitly use it. I've found a fringe use case for turning off an undesired cascading effect however. Looky:

#foo ul {
   position: absolute;
   margin: 0;
   margin-left: -300px;
   padding: 0;
}
#foo ul li ul {
   position: static;
   margin-left: 25px;
}

No comments:

Post a Comment