WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Cannot Add CSS To My Child Theme (3 posts)

  1. sclowes14
    Member
    Posted 1 year ago #

    Hi All!

    So here is my dilemma..

    I am attempting to create a child theme for Twenty Twelve. I have successfully created and activated my child theme. I have also successfully imported the Twenty Twelve parent style sheet. Here is the code:

    /*
    
    Theme Name: Son of Twenty Twelve
    Description: Child theme based on the default WordPress Twenty Twelve.
    Author: Stephen Clowes
    Version: 0.0.1
    Template: twentytwelve
    
    */
    
    @import url('../twentytwelve/style.css')

    Here is where it gets interesting. Whenever I attempt to add any CSS to override the parent style sheet, not only does it not work, it takes away the entire theme (it goes back to simple html). For example:

    /*
    
    Theme Name: Son of Twenty Twelve
    Description: Child theme based on the default WordPress Twenty Twelve.
    Author: Stephen Clowes
    Version: 0.0.1
    Template: twentytwelve
    
    */
    
    @import url('../twentytwelve/style.css')
    
    a{
    	color: #ff43s5;
    }

    I am so confused.. The import works successfully and chrome dev tools is showing no broken connection to the style sheet, but the theme completely disappears. I hope this does a good job explaining it. I am new to WordPress and PHP, but I know my HTML and CSS. WordPress community please reach out and guide me to the light! Sorry I have got a host yet for my site.

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    You are missing a semi-colon at the end of this line:

    @import url('../twentytwelve/style.css');
  3. sclowes14
    Member
    Posted 1 year ago #

    Wow.. So simple yet so easy to miss. Worked perfectly thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic