There are no tracking or monitoring cookies on this site. There are only cookies used for documentation examples related to cookies.Close
Processing...
This may take a few seconds.

if-max-height

Syntax

if-max-height: (element) integer;

This conditional action will return true if the chosen selector has a maximum display height of the specified value. This is useful if you need to set a class based on an element's height. Media queries only allow checking for device width and sometimes this isn't enough, so this is a workaround solution for that. Of course, this conditional can be used for other purposes as well.

element = Selector reference to a specific element.

integer = The maximum height of the element. This can include the "px" or it can be left out.

 

For example, this will return true if the element #myInput has a height less than 400px.

@conditional ifSmallDiv {
    if-max-height: #myDiv 400px;
}

Note: Internally this uses the element.getBoundingClientRect() JavaScript method of fetching the height of the element.