shenkwen shenkwen - 2 years ago 240
CSS Question

sass: calculation between vh and px

I have a slideshow on my landing screen that I want it to be fullscreen combined with a 70px height nav bar, I am trying to use sass so that I don't have to write javascript code for this, but


doesn't work. I don't know how sass calculates it, the CSS turns out to be


I did a quick search against this issue but couldn't find any useful information. So is this doable at all?

And if no, is there anyway to do it without javascript?

Answer Source

Try using CSS calc. It's pretty widely supported.

.slideshow {
    height: calc( 100vh - 70px );
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download