J
J
Jack OXO2015-10-05 14:20:41
css
Jack OXO, 2015-10-05 14:20:41

How to swap two divs in mobile layout?

Here is the site . At the bottom are contacts from two blocks: a map and pasting addresses. How to swap them in the mobile layout (@media (max-width: 481px)) so that the map is under the contact form? It's just impossible to scroll to the contact form through the Yandex map on the phone. Thanks in advance!

Answer the question

In order to leave comments, you need to log in

4 answer(s)
L
Lumore, 2015-10-05
@oxojeck

Try swapping these divs:

<style>
#contacts {
float: right;
}
#map {
float: left;
}
@media screen and (max-width: 481px) {
#map, #contacts {
float: none;
}
}
</style>
<div id="contacts"></div>
<div id="map"></div>

D
Dmitry Pyrkin, 2015-10-05
@ps1panda

section{
display: flex; 
        display: -webkit-flex ;
  -webkit-flex-direction: column;
  flex-direction: column;
  display:-webkit-box;
  -webkit-box-orient:vertical;
}
.block1{
    -webkit-box-ordinal-group: 2;
    -webkit-order: 2;              
    order: 2;  
  }
  .block2{
       -webkit-box-ordinal-group: 1;
    -webkit-order: 1;                   
    order: 1;  
  }

3
3luyka, 2015-10-05
@3luyka

<div class="right-side" style="float: right;">Left side</div>
<div class="left-side" style="float: left;">Right side</div>

@media and (max-width: ....) {
.right-side{ float: left; }
.left-side{ float: right; }
}

Z
zjoin, 2015-10-05
@zjoin

You can use flexbox in ccs: there is an order property that swaps elements

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question