• Resolved melanie bund

    (@melanie-bund)


    Hi.am using 2012 child theme and for some reason my media queries will not work, they are overridden by the main css. even when i try to hide the sidebars they are still there – below are the snippets. First i need to hide the sidebars and second the header i need to change the logo and search bar from inline-block to block, so rather blocks side by side they are blocks under each other – have no idea why nothing changes – does 2012 have a viewport file tucked away that i need to find?

    /* Header */
    .site-logo {
    	float:left;
    	display:inline-block;
        width: 60%;
    	vertical-align: top;
    }
    .header-search { float:right;
    display:inline-block;
    width: 40%;
    vertical-align: top;
    margin-top:2%;
    }
    img.logo {
    	height:auto; width:auto; }
    /* Tablet */
    @media only screen and (min-width: 720px) and (max-width: 800px) {
    #sidebar {display:none;}
    #sidebar-profile {display:none;} }
    /* Mobile  */
    @media only screen and (max-width: 719px) {
    #sidebar {display:none;}
    #sidebar-profile {display:none;}
    #site-content-left {
    width: 95%;
    margin:0 auto;
    }
    .site-logo {
    	display:block;
        width: 100%;
    	margin: 0 auto;
    }
    img.logo {
    	height:auto; width:auto; margin: 0 auto; }
    .header-search {
        display:block;
        width: 100%;
    	margin: 0 auto;
    }}
    /* Mobile - 320px */
    @media only screen and (max-width: 479px) {
    #sidebar {display:none;}
    #sidebar-profile {display:none;}
    #site-content-left {
    width: 95%;
    margin:0 auto;
    }
    .site-logo {
    	display:block;
        width: 100%;
    	margin: 0 auto;
    }
    img.logo {
    	height:auto; width:auto; margin: 0 auto; }
    .header-search {
        display:block;
        width: 100%;
    	margin: 0 auto;
    }}

    site
    https://www.photohunters.org

    Thank you Melanie

Viewing 12 replies - 1 through 12 (of 12 total)
  • I haven’t tested any of this on your site, but at a glance your logo and search are probably still floated since you haven’t over-ridden that with float:none; or something suitable.

    On the sidebar issue, see if display:none !important; does anything to help.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you link the page in question?

    Thread Starter melanie bund

    (@melanie-bund)

    Hi the link is
    https://www.photohunters.org
    thank you
    melanie

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Last time I looked, there was no element with the ID of “sidebar” on that page. Can you link to the page with that element (the element that you are targeting in CSS)?

    Thread Starter melanie bund

    (@melanie-bund)

    Hi yes
    https://photohunters.org/2nd-hand-market/
    the other pages with sidebars are login, though can give you a temp login if needed
    thanks
    Melanie

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Okay, so you’ve got this bit of CSS:

    /* Tablet */
    @media only screen and (min-width: 720px) and (max-width: 800px) {
    
    .box {
          display:block;
          display:none;
          background:#FFF;
          border:solid 1px #BBBBBB;
          border-radius:5px;
          box-shadow:0px 0px 15px #999;
          position:absolute;
    	  margin-left: -40%;
    	  margin-top:30px;
    }
    /* Mobile  */
    @media only screen and (min-width: 480px) and (max-width: 719px) {
    #sidebar {display:none;}

    But you’re not closing off your Tablet Media Query, do you see? That’s not going to work.

    Thread Starter melanie bund

    (@melanie-bund)

    Hi sorry – i did not post all the css, as i have been adding and taking away for the last few days trying to solve the problem – it is closed off. the 2012 parent css has media queries do you think thats the problem as they may be overlapping my media queries?

    .box {
          display:block;
          display:none;
          background:#FFF;
          border:solid 1px #BBBBBB;
          border-radius:5px;
          box-shadow:0px 0px 15px #999;
          position:absolute;
    	  margin-left: -40%;
    	  margin-top:30px;
    }
    #sidebar {display:none;}
    #sidebar-profile {display:none;} }

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    But I took that code from your “2nd hand market” page/

    Media Queries need to be closed off before you start other media queries. You can’t nest a mobile media query inside of a tablet media query. Why would you want to?

    Thread Starter melanie bund

    (@melanie-bund)

    With the tablet – am testing on a toshiba with windows 8, if it doesnt use viewport, which it seems not to and the new generation may not how does one size for that?

    Thread Starter melanie bund

    (@melanie-bund)

    this is so odd as it looks closed
    here is all of it and the staement all look closed

    /* Tablet */
    @media only screen and (min-width: 720px) and (max-width: 800px) {
    
    .box {
          display:block;
          display:none;
          background:#FFF;
          border:solid 1px #BBBBBB;
          border-radius:5px;
          box-shadow:0px 0px 15px #999;
          position:absolute;
    	  margin-left: -40%;
    	  margin-top:30px;
    }
    #sidebar {display:none;}
    #sidebar-profile {display:none;} }
    /* Mobile  */
    @media only screen and (max-width: 719px) {
    #sidebar {display:none;}
    #sidebar-profile {display:none;}
    #respond {
    	width: 100%;
    	clear:both;
    }
    #site-content-left {
    width: 95%;
    margin:0 auto;
    }
    .site-logo {
    	display:block;
        width: 100%;
    	margin: 0 auto;
    }
    img.logo {
    	height:auto; width:auto; margin: 0 auto; }
    .header-search {
        display:block;
        width: 100%;
    	margin: 0 auto;
    }
    img.fb {
    	display:none;}
    
    p.photographer-name {font-size: 12px;
    	color: #000;
    	font-weight: normal;
    	text-transform:uppercase;
    	text-align:center;
    	line-height: 2;
    	}	
    
    .counter{ font-size:12px; color: #666; line-height: 2;}
    }
    /* Mobile - 320px */
    @media only screen and (max-width: 479px) {
    #sidebar {display:none;}
    #sidebar-profile {display:none;}
    #respond {
    	width: 100%;
    	clear:both;
    }
    #site-content-left {
    width: 95%;
    margin:0 auto;
    }
    .site-logo {
    	display:block;
        width: 100%;
    	margin: 0 auto;
    }
    img.logo {
    	height:auto; width:auto; margin: 0 auto; }
    .header-search {
        display:block;
        width: 100%;
    	margin: 0 auto;
    }
    img.fb {
    	display:none;}
    
    p.photographer-name {font-size: 12px;
    	color: #000;
    	font-weight: normal;
    	text-transform:uppercase;
    	text-align:center;
    	line-height: 2;
    	}	
    
    .counter{ font-size:12px; color: #666; line-height: 2;}
    }

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    That’s not what’s coming out of your Child Theme style.css file:
    https://photohunters.org/wp-content/themes/twentytwelve-child/style.css?ver=4.0.1

    Thread Starter melanie bund

    (@melanie-bund)

    THANK YOU – i can only think i did not upload the last version – thank yu for your patience
    Melanie

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘media queries being overridden by original csss’ is closed to new replies.