• Resolved ankitseth

    (@ankitseth)


    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(https://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)
  • 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(https://i2.wp.com/vedsutra.com/wp-content/uploads/2016/07/cropped-VedSutra_logo.png);
        background-repeat: no-repeat;
        background-position: center;
      }
    }
    Thread Starter ankitseth

    (@ankitseth)

    Thanks at ton ??

    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.