Documentation on using calc()

I am trying to create a column which covers 100% of the view less 100px header. To do this i was going to use the calc() option for the height of the column i.e calc(100vh-100px) but this doesn’t seem to work. 100vh works but is obviously too heigh by 100px (the height of the header)

do you have any documentation on using the calc() option to set either a column or div height

Hi @The_Capture_Factory,

Can you please share any URL where you have implemented it? So we can investigate and suggest what exactly happening at your end.

Thanks

This is the page. The column which contains the slide container has its height set to calc(100vh-100px) . The header bar is set to 100px

https://manifoldvalleyshow.co.uk/

Hey @The_Capture_Factory,

We don’t have any documentation for using calc but you can check this as reference:

Hope that helps.

1 Like

Hey,
you need to put whitespaces between around the operator (-) like this:

calc(100vh - 100px)

Mozilla Documentation:

  • The + and - operators must be surrounded by whitespace . For instance, calc(50% -8px) will be parsed as “a percentage followed by a negative length” — which is an invalid expression — while calc(50% - 8px) is “a percentage followed by a subtraction operator and a length”. Likewise, calc(8px + -50%) is treated as “a length followed by an addition operator and a negative percentage”.
2 Likes

Hey @sparko,

Thanks for chiming in, we really appreciate your time and effort.

Cheers!

1 Like

Fantastic, thats a great help many thanks. So simple in the end. :slight_smile:

Thanks for this. Can i suggest you put these links in the documentation section .

Many thanks

1 Like

Hi @The_Capture_Factory,

We will surely consider your suggestion of adding this to our documentation.

Thanks