Skip to content

Box sizing… the recommended way

Box sizing… the recommended way

Changing your box sizing model from content-box to border-box is a great way of dealing with measurements.

/**
 * Set the global `box-sizing` to 'border-box'
 *
 * css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice
 * paulirish.com/2012/box-sizing-border-box-ftw
 */

html {
    -webkit-box-sizing: border-box;
       -moz-box-sizing: border-box;
            box-sizing: border-box;
}

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

No comments

Add a comment

Start the conversation.
Be the first to comment.

Popular topics

On development

On best practice

On content strategy