css - height in vh (viewport) and max-height in px (pixels) -


It is possible to define an element's height where CSS3 indicates:

  if the viewport & Gt; = 1000px then element height: 300px (in pixels) and if the viewport is & lt; 1000 PX element height: 30 VH (30% of viewpoint height)  

So I want to be an element with 30% viewport but no more than 300px. Is this possible?

I decided but did not work:

  div {height: 30vh; Max-height: 300px; }  


Comments

Popular posts from this blog

python - Strange behavior using PyQt4's 'pyqtSlot' decorator before another decorator -

c# - UnhandledExceptionMode.ThrowException for AppDomain.UnhandledException -

c# - Process.Kill() returns access denied -