Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS calc width and height values

Tags:

html

css

How can I calc, using css, the screen height and use the returned value for the width calculation? is it possible at all?

myClass{    
    height: calc(50% - 33.5px);
    width: heightReturnedValue*1.3
}
like image 463
KBE Avatar asked Apr 22 '18 07:04

KBE


1 Answers

Yes, in css there is a thing called vh (viewport height) and vw (viewport width). The viewport is the screen.

myClass {    
  height: calc(50% - 33.5px);
  width:  calc(100vh * 1.3);
}
like image 148
Johey Avatar answered Sep 23 '22 21:09

Johey