css - margin-top: calc(%) is using percent of width rather than desired percent of height -


i using margin-top: calc(100% - $value) intent calculation involve 100% of height calculate top-margin. however, in practice making calculation based on 100% of width.

anyone have clues how base calculation on percent height rather width? (so far, i've checked undesired behavior happening in both chrome , ff).

https://jsfiddle.net/bfxhebc3/

per css spec, percentage values margin, including margin-top, based off width of containing block.

if referring height of window, can use vh instead of percent:

margin-top: calc(100vh - $value); 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -