WordPress.org

Ready to get started?Download WordPress

Forums

child theme not overriding widget css (4 posts)

  1. bkdev
    Member
    Posted 2 weeks ago #

    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%;
    }
  2. bkdev
    Member
    Posted 2 weeks ago #

    works fine if i change the code in the parent template, wonder why?

  3. tasko
    Member
    Posted 2 weeks ago #

    Try this:

    .widget .widget-title {
      font-family: "Source Sans Pro",Helvetica,sans-serif;
      font-weight: bold;
    }
  4. pantspress
    Member
    Posted 2 weeks ago #

    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.

Reply

You must log in to post.

About this Topic