# Trouble changing the stacking order in mobile view.

**URL:** <https://community.hubspot.com/t/trouble-changing-the-stacking-order-in-mobile-view/2812>\
**Category:** CMS Development\
**Created:** [July 24, 2017, 4:27pm UTC](https://community.hubspot.com/t/trouble-changing-the-stacking-order-in-mobile-view/2812 "2017-07-24T16:27:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzimmermann](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jzimmermann/32/101551_2.png) [@jzimmermann](https://community.hubspot.com/u/jzimmermann)\
**Post date:** [July 24, 2017, 4:27pm UTC](https://community.hubspot.com/t/trouble-changing-the-stacking-order-in-mobile-view/2812/1 "2017-07-24T16:27:46Z")

</div>

Hello all!

So I’m looking to change the stacking order of some elements on this page ([http://www.tminc.com/voice-and-broadband-reporting-service](http://www.tminc.com/voice-and-broadband-reporting-service)) so that the first form on this page would display underneath the header in a mobile view and have the rest of the elements stack file in underneath that.

I’ve used this article ([https://knowledge.hubspot.com/articles/kcs\_article/cos-general/how-can-i-customize-my-mobile-stacking-order](https://knowledge.hubspot.com/articles/kcs_article/cos-general/how-can-i-customize-my-mobile-stacking-order)) which seems like it has what I need, to edit the stylesheet and apply what I think shouldbe the correct styles to make this work. Below is the styling I’m applying…

@media screen and (max-width:768px) {

.stack-group \> .row-fluid-wrapper \> .row-fluid{  
display: -webkit-box;  
display: -moz-box;  
display: -ms-flexbox;  
display: -webkit-flex;  
display: flex;  
-webkit-flex-flow: row wrap;  
-moz-flex-flow: row wrap;  
-ms-flex-flow: row wrap;  
flex-flow: row wrap;  
}  
.tmi-offer{  
order: 5;  
-webkit-order: 5;  
-moz-order: 5;  
-ms-order: 5;  
width: 100%;  
}  
.top-banner {  
order: 4;  
-webkit-order: 4;  
-moz-order: 4;  
-ms-order: 4;  
width: 100%;  
}  
}  
.content-one{  
order: 3;  
-webkit-order: 3;  
-moz-order: 3;  
-ms-order: 3;  
width: 100%;  
}  
.content-two {  
order: 2;  
-webkit-order: 2;  
-moz-order: 2;  
-ms-order: 2;  
width: 100%;  
}  
}  
.tmi-contact-form{  
order: 1;  
-webkit-order: 1;  
-moz-order: 1;  
-ms-order: 1;  
width: 100%;  
}

I feel like I’m pretty close but I’m unsure where I’m going wrong here. Any help anyone can provide would be greatly appreciated!

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![DaniellePeters](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/daniellepeters/32/6115_2.png) [@DaniellePeters](https://community.hubspot.com/u/DaniellePeters)\
**Post date:** [July 24, 2017, 6:38pm UTC](https://community.hubspot.com/t/trouble-changing-the-stacking-order-in-mobile-view/2812/2 "2017-07-24T18:38:19Z")

</div>

You have soem extra closing curly brackets in there which is probably causing the problem. Try this:

```auto
@media screen and (max-width:768px) {
 .stack-group > .row-fluid-wrapper > .row-fluid{
 display: -webkit-box;
 display: -moz-box;
 display: -ms-flexbox;
 display: -webkit-flex;
 display: flex;
 -webkit-flex-flow: row wrap;
 -moz-flex-flow: row wrap;
 -ms-flex-flow: row wrap;
 flex-flow: row wrap;
 }
 .tmi-offer{
 order: 5;
 -webkit-order: 5;
 -moz-order: 5;
 -ms-order: 5;
 width: 100%;
 }
 .top-banner {
 order: 4;
 -webkit-order: 4;
 -moz-order: 4;
 -ms-order: 4;
 width: 100%;
 }
 .content-one{
 order: 3;
 -webkit-order: 3;
 -moz-order: 3;
 -ms-order: 3;
 width: 100%;
 }
 .content-two {
 order: 2;
 -webkit-order: 2;
 -moz-order: 2;
 -ms-order: 2;
 width: 100%;
 }
 .tmi-contact-form{
 order: 1;
 -webkit-order: 1;
 -moz-order: 1;
 -ms-order: 1;
 width: 100%;
 }
}

```

---

<div class="post-metadata">

**Author:** ![jzimmermann](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jzimmermann/32/101551_2.png) [@jzimmermann](https://community.hubspot.com/u/jzimmermann)\
**Post date:** [July 24, 2017, 10:01pm UTC](https://community.hubspot.com/t/trouble-changing-the-stacking-order-in-mobile-view/2812/3 "2017-07-24T22:01:38Z")

</div>

Thanks for looking into this Danielle! Unfortunately it doesn’t seem like this made any impact on the stacking order of the elements in the mobile view.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [July 25, 2017, 7:34am UTC](https://community.hubspot.com/t/trouble-changing-the-stacking-order-in-mobile-view/2812/4 "2017-07-25T07:34:57Z")

</div>

Hi @jzimmermann,  
I was able to make this happen with the following code,

```auto
@media (max-width:767px){

#stack-group{
display:flex;
flex-direction:column;
}

#stack-group .row-fluid-wrapper:nth-child(3) {
 order: 1;
}

#stack-group .row-fluid-wrapper {
 order: 2;
}

}

```

Your display:flex has effect on immediate child elements i.e, .row-fluid-wrapper and not your inside classes.

---

<div class="post-metadata">

**Author:** ![jzimmermann](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jzimmermann/32/101551_2.png) [@jzimmermann](https://community.hubspot.com/u/jzimmermann)\
**Post date:** [July 25, 2017, 2:48pm UTC](https://community.hubspot.com/t/trouble-changing-the-stacking-order-in-mobile-view/2812/5 "2017-07-25T14:48:14Z")

</div>

@Anonymous thanks! This did the trick!
