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

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -