0

I'm working with some CSS code to keep a footer at the bottom of the page no matter the content, device, browser, etc. I'm wondering though why the :before and :after selectors are needed:

*,
*:before,
*:after {
  box-sizing: inherit;
}

To see all the code: https://codepen.io/cbracco/pen/zekgx

Ben Davidow
  • 1,175
  • 5
  • 23
  • 51
  • See http://stackoverflow.com/questions/23542579/purpose-of-before-after-css-snippet and http://stackoverflow.com/questions/24794545/universal-selector-and-pseudo-elements – BoltClock Aug 11 '16 at 17:02

1 Answers1

3

In that example the :before and :after selectors are not being used for the footer positioning, but it is just part of a reset the author used to ensure that everything is box-sizing: border-box

JustH
  • 1,372
  • 8
  • 8