Skip to content
Advertisement

Tag: calc

What is 100% in calc function

Within the css calc() function, what does 100% refer to and what is the equivalent code in JavaScript? JSFiddle: https://jsfiddle.net/xoufnm6v/ Answer 100% refers to 100% of the width of the parent element. This calculation gives the current element a width 100 pixels narrower than it’s parent.

Advertisement