J
J
John2016-02-18 16:23:40
css
John, 2016-02-18 16:23:40

Calculating the height of an element in less?

There is a parent element with a height of 500px. How to make the child element take the height of the parent element, calculate 30% from there, for example, and write this data to its height?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Georgy Eremeev, 2016-02-18
Galt @Fargal_1

@my-width: 500px;
div{
    width: @my-width;
    div{
        width: @my-width * .7;
    }
}

V
Vitaly Kirenkov, 2016-02-18
@DeLaVega

If you need to write something - this is js.
If you make an inner block that is 30% of the parent's height, then you write it like this - height: 30%, although I'm not sure if this will work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question