Calc using CSS3 () calculate the height vh px

Viewport
    v iewport: visual window, which is the browser.
    vw Viewport width, 1vw equal viewport 1% width
    vh Viewport height, 1 VH equal viewport 1% higher of
using CSS3 Calc
Calc () using common mathematical notation, but also provide a more intelligent features:
    using the "+", " - "," * "and" / "four operations;
    can percentage, px, em, rem other units;
    can be mixed with various calculation units;
    expression in the" + "and" - ", it must longitudinal have a space, such as "widht: calc (12% + 5em)" this is not writing space is wrong;
    the expression of "*" and "/", it can be no space before and after, but it is recommended to leave a space . For example: Set the height of the div element for the current window height -100px
  

  div{
       height: calc(100vh - 100px);     
    }

 

Guess you like

Origin www.cnblogs.com/zouhong/p/12016138.html