Jump to content

Making code only work on PC not mobile

Recommended Posts

Hey I want this code to work on the desktop version of my website but not the mbile version as the code breakes the mbile version can anyone help

.header-title-nav-wrapper {

  flex: 1 0 85% !important;

  flex-wrap: nowrap !important;

}

.header-nav {

  width: 100% !important;

  flex: 1 1 100% !important;

}

 

Link to comment
  • Replies 2
  • Views 415
  • Created
  • Last Reply
On 3/29/2021 at 9:18 PM, Sausagemunk said:

Hey I want this code to work on the desktop version of my website but not the mbile version as the code breakes the mbile version can anyone help

.header-title-nav-wrapper {

  flex: 1 0 85% !important;

  flex-wrap: nowrap !important;

}

.header-nav {

  width: 100% !important;

  flex: 1 1 100% !important;

}

 

Remove your code & try this code

/* work on desktop only */
@media screen and (min-width:992px) {
.header-title-nav-wrapper {
  flex: 1 0 85% !important;
  flex-wrap: nowrap !important;
}

.header-nav {
  width: 100% !important;
  flex: 1 1 100% !important;
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.