Thursday, January 19, 2017

CSS: box-sizing: content-box vs border-box


Sources: http://www.w3schools.com/cssref/css3_pr_box-sizing.asp | https://css-tricks.com/box-sizing/ | http://www.binvisions.com/articles/box-sizing-property-difference-content-border/

Box-sizing

  • content-box
    • Default. 
    • Width or height = content's width or height. Border, padding, or margin are not included
  • border-box
    • Width or height = content + padding + border width or height. Margin is not included.
  • initial
    • Sets this property to its default value.
  • inherit
    • Inherits this property from its parent element.


No comments:

Post a Comment