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).
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
Post a Comment