Title: Problem with custom media query
Last modified: November 3, 2016

---

# Problem with custom media query

 *  Resolved [ankitseth](https://wordpress.org/support/users/ankitseth/)
 * (@ankitseth)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problem-with-custom-media-query/)
 * Hi,
 * I am facing some issues with custom media query in css. When I try to save the
   code it vanishs and doesn’t reflect on site. Any help on this would be greatly
   appreciated. I am trying to add the following code:
 *     ```
       @media only screen and (max-width: 719px)
       .site-title {
           display: none;
       }
   
       @media only screen and (max-width: 719px)
       #nav-header.nav-container {
           background-image: URL(http://i2.wp.com/vedsutra.com/wp-content/uploads/2016/07/cropped-VedSutra_logo.png);
           background-repeat: no-repeat;
           background-position: center;
       }
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [bdbrown](https://wordpress.org/support/users/bdbrown/)
 * (@bdbrown)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problem-with-custom-media-query/#post-8393063)
 * Hi ankitseth. Each media query is self-contained so you need to add brackets 
   before and after the styles contained within the query. Also, since your query
   criteria is the same for both queries you can combine them into one:
 *     ```
       @media only screen and (max-width: 719px) {
         .site-title {
           display: none;
         }
         #nav-header.nav-container {
           background-image: URL(http://i2.wp.com/vedsutra.com/wp-content/uploads/2016/07/cropped-VedSutra_logo.png);
           background-repeat: no-repeat;
           background-position: center;
         }
       }
       ```
   
 *  Thread Starter [ankitseth](https://wordpress.org/support/users/ankitseth/)
 * (@ankitseth)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problem-with-custom-media-query/#post-8393103)
 * Thanks at ton 🙂
 *  [bdbrown](https://wordpress.org/support/users/bdbrown/)
 * (@bdbrown)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problem-with-custom-media-query/#post-8393656)
 * You’re welcome; glad to help.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Problem with custom media query’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/hueman/3.7.27/screenshot.png)
 * Hueman
 * [Support Threads](https://wordpress.org/support/theme/hueman/)
 * [Active Topics](https://wordpress.org/support/theme/hueman/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/hueman/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/hueman/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [bdbrown](https://wordpress.org/support/users/bdbrown/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/problem-with-custom-media-query/#post-8393656)
 * Status: resolved