Support » Fixing WordPress » child theme not overriding widget css

  • For some reason my child theme style.css will not override the css setting for the text widget from the parent. I have other overrides in the child theme and they are working, not sure why the widget override will not work.

    my site is http://www.gadgetplex.com

    here is what i have in my child theme style.css, i copied the bad widget css from the parent and replace “italic” with “strong” but it will not override the parent

    /*
    Theme Name: 2013_Child_Theme
    Template: twentythirteen
    Author: BK
    Version: 1.0
    Updated: 2014-07-08 12:24:07
    */
    
    @charset "UTF-8";
    @import url('../twentythirteen/style.css');
    
    .widget .widget-title {
        font: strong 300 20px "Source Sans Pro",Helvetica,sans-serif !important;
        margin: 0 0 10px !important;
    }
    
    .nav-menu {
    	text-align: center;
    }
    
    .page-id-14 #content {
    	width: 100%;
    }
    .page-id-14 .site-content{
        width:100%;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • works fine if i change the code in the parent template, wonder why?

    Try this:

    .widget .widget-title {
      font-family: "Source Sans Pro",Helvetica,sans-serif;
      font-weight: bold;
    }

    tasko’s solution should work but if you want to use the font shorthand syntax try this:

    .widget .widget-title {
        font: bold 20px "Source Sans Pro",Helvetica,sans-serif !important;
        margin: 0 0 10px !important;
    }

    The initial CSS resolves to font-style:italic and font-weight:300.

    You replaced “italic” with “strong” and left the 300 parameter in place. This will resolve to font-style:strong and font-weight:300 and, since “strong” is not a valid font-style, you are getting an invalid property value error.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘child theme not overriding widget css’ is closed to new replies.