A
A
Alexey2016-03-08 14:46:48
css
Alexey, 2016-03-08 14:46:48

How to fix these responsive columns?

I put two adaptive blocks on the site, in one of which I placed the VK block, in the other a third-party module. For some reason, VK refuses to adapt to the block, how to fix it?

<div id="columns">
    
    <div><script type="text/javascript" src="//vk.com/js/api/openapi.js?121"></script>
    <!-- VK Widget -->
  <div id="vk_groups"></div>
  <script type="text/javascript">
    VK.Widgets.Group("vk_groups", {mode: 2, wide: 1, width: "auto", height: "400"}, 65273602);
  </script></div>
  
  <div>
    {include file="/engine/modules/moonserials_block.php"}
  </div>
</div>

#vk_groups,
#vk_groups iframe {
     width: 100% !important;
}

#columns {
    display: table;
    width: 100%;
    box-sizing: border-box; 
    margin-left: 0;
    margin-right: 0;
}

#columns > div {
    display: table-cell;
    vertical-align: top;
    width: auto;
    box-sizing: border-box;  /* не поддерживается в CSS2 */
}

f4d2749da9a24cc8b6d8de1496975149.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2016-03-08
@webinar

The VK widget is a headache. The easiest way is to write js, take the size of the parent div and explicitly assign it to the widget. then load the widget
yet I suspect your #columns > div is not stretchable.

D
Dmitry Krymtsev, 2016-03-08
@krimtsev

<div>
    
    <div><script type="text/javascript" src="//vk.com/js/api/openapi.js?121"></script>
    <!-- VK Widget -->
  <div id="vk_groups"></div>
  <script type="text/javascript">
    VK.Widgets.Group("vk_groups", {mode: 2, wide: 1, width: "auto", height: "400"}, 65273602);
  </script></div>
  
  <div id="columns">
    {include file="/engine/modules/moonserials_block.php"}
  </div>
</div>

and specify the dimensions for VK in {mode: 2, wide: 1, width: "auto", height: "400"}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question