• Resolved reachingout

    (@reachingout)


    Hi,

    Classes (or id’s) that I define in style.css do not affect the layout.

    For example, no effect on layout when I define this in style.css:

    .test111 {background-color:red;}

    So I have to define the style inline in the editor in order to have an effect:

    <div class="test111" style="background-color:red;">something</div>
    
    

    How can I make style.css work? (I do not have any child theme folder, I am only working in the main parent theme)

    • This topic was modified 1 year, 8 months ago by reachingout.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @reachingout,

    It’s not recommended to modify the parent theme’s files, including the style.css file. Anything you have done on the parent theme’s files will get rid of when you update the theme.

    Please add your custom CSS to the Additional CSS field of the Customizer. If there’s nothing wrong with the CSS code itself, it will work.

    Let us know if you need more help, otherwise please mark the topic as Resolved.

    Kind regards,
    Herman ??

    Thread Starter reachingout

    (@reachingout)

    I also tried to make a folder called Astra-child and put a style.css in it, but with no effect.

    There surely has to be a css file where I can put my own classes and id’s?

    I will remember to save the style.css somewhere before updating the theme, so that is not a problem.

    Hi @reachingout,

    Have you tried what I asked/suggested in my previous response?

    As for the CSS you added to the child theme is not working, please refer to this thread.

    Kind regards,
    Herman ??

    Thread Starter reachingout

    (@reachingout)

    I got my parent style.css to work by adding this to my parent functions.php:

    add_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_styles’ );

    function enqueue_parent_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ );
    }

    Hi @reachingout,

    So, did you consider this as resolved? If you did, please mark this thread as Resolved and feel free to start a new thread if there is anything else related to Astra we can help you with.

    Kind regards,
    Herman ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘style.css not working’ is closed to new replies.