Such a task: put a google-map on the site, the size of which is determined by the size of the parent container. The size of the parent container itself is determined by the relative width (say, 80%).
<div id="AccessMap"> <iframe src="..." frameborder="0" style="border:0" allowfullscreen> </iframe> </div>
The problem I encountered is that LESS
does not convert percentages into absolute values, that is, for example
@AccessMapRatio: 9/16; // Пусть соотношение сторон карты будет 16:9 @AccessMapWidth: 80%; @AccessMapHeight: @AccessMapWidth*@AccessMapRatio;
will not result in pixels, but in percentages. I also tried
@AccessMapHeight:calc(~'@{AccessMapWidth}*@{AccessMapRatio}');
and even the result in CSS seems to be correct:
height: calc(80%*0.5625);
but still my map does not look like 16: 9.
#AccessMap{ width: @AccessMapWidth; height: @AccessMapHeight; margin: 0 auto; background-color:#66ff66; iframe{ //width: 100%; //height: @AccessMapHeight; } }
What's my mistake?