WordPress.org

Ready to get started?Download WordPress

Forums

CSS code not changing things (14 posts)

  1. NollieHeel
    Member
    Posted 5 months ago #

    Hi-
    Got trouble with my CSS code in my style.css file showing up.
    I created a child theme too so it wont get messed up in the future.
    None of the code used for testing does anything to the page.

    Here it is, can anybody verify why nothing happens?

    /*
    Theme Name: mckinley-child
    Theme URI: http://example.com/mckinley/
    Description: Mckinley Child Theme
    Author: MM
    Author URI: http://example.com
    Template: mckinley
    Version: 1.0.0
    Tags: schweet
    Text Domain: mckinley-child
    */

    @import url("../mckinley/style.css");

    /* =Theme customization starts here
    -------------------------------------------------------------- */

    a.home-link {
    color: red;
    }

    div.entry-content {
    color: blue;
    }

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

  2. Wolfs bRain
    Member
    Posted 5 months ago #

    Hi Nollie
    I'm not exactly sure what part of your site it is that you'd like to change. But i searched through your html to try and find what you might be wanting to change.

    Try this code and let me know if these parts of the site are the ones you wanted to change.

    #post-5 > div {
    color: green;
    }
    #masthead > a {
    color: red;
    background-color: red;
    }

    If you have any more questions please feel free to ask.

    Wolfy and Brain

  3. batharoy
    Member
    Posted 5 months ago #

    I can see that the entry content is blue as you specified.
    Your html output does not have any selector of a.home.link
    What exactly is it you want red?

  4. CrouchingBruin
    Member
    Posted 5 months ago #

    One of the problems is that you didn't define the site title and tag line in your WordPress settings. Here's what your header looks like:

    <header id="masthead" class="site-header" role="banner">
    <a class="home-link" href="http://www.mattmm.com/" title="" rel="home">
    	<h1 class="site-title"></h1>
    	<h2 class="site-description"></h2>
    </a>

    So you can see there's no content in the h1 tags (your site title) or your h2 tags (your tagline). Go to Settings > General and fill in the site title and tagline so there's some content to display.

    However, once you do that, you'll notice that there's another CSS rule that's overriding your a.home-link selector. There's a rule that looks like this:

    .site-header .home-link {
    color: #fff;
    display: block;
    padding: 40px 0 20px 0;
    text-decoration: none;
    }

    So what you should do is change your own selector to match the one you're trying to override:

    .site-header .home-link {
    color: red;
    }
  5. NollieHeel
    Member
    Posted 5 months ago #

    .site-header .home-link {
    color: #fff;
    display: block;
    padding: 40px 0 20px 0;
    text-decoration: none;
    }

    Where did you find that code ?

    Im trying to just change the color of some content basically... since I entered the CSS I had from when my site was on wordpress.com, and nothing happened.

  6. Wolfs bRain
    Member
    Posted 5 months ago #

    He found it in your parent themes style.css file. By the look of your site seems your getting the hang of it. Mazeltov!

    If there's anything specific on the site you'd like to change ask away.

  7. CrouchingBruin
    Member
    Posted 5 months ago #

    Where did you find that code ?

    It's in the parent theme's style.css file, around line 835.

    Looks like you got it working. Just as a tip, unless you are using the exact same theme as your site on wordpress.com, the CSS selectors might not be the same. Use a web debugging tool like Firebug or Chrome Developer Tools to see what selectors to use for specific elements.

  8. NollieHeel
    Member
    Posted 5 months ago #

    Ah I see. its in the parent theme css.

    I still wish to have the header text display in the web browser TAB, but not on the website page itself.

    and still not seeing any changes immediately after editing my child theme CSS file, no matter what I put in.
    confused!

  9. NollieHeel
    Member
    Posted 5 months ago #

    Another factor I'm considering is the Safari (xml?) document I exported from when my site was at wordpress.com, and imported into my site when I got it set up at wordpress.org.
    Could that have anything to do with the changes not showing up ?

  10. CrouchingBruin
    Member
    Posted 5 months ago #

    I still wish to have the header text display in the web browser TAB, but not on the website page itself.

    You can set the visibility to hidden. That way, the text will still display in the browser tab but not on the site.

    .site-title, .site-description {
       visibility: hidden;
    }

    still not seeing any changes immediately after editing my child theme CSS file, no matter what I put in.

    I didn't see any sort of caching plugin in your code. You might have to clear your browser cache after each change; kind of a pain in the butt.

    How were you able to import an XML doc into your theme? I don't think that would have anything to do with your site not updating right away.

  11. NollieHeel
    Member
    Posted 5 months ago #

    Yeah the cching plugin might work; in the future though. they say to download it only after your website is finished with its design.
    I deleted browsing history, etc. and now I see the changes.

    Tools> import
    I imported the doc that wordpress.com gave me, it was a Safari document, which my naïve a** thought weird because they're talking about an xml.

    Thank you all for help so far!
    Im sure Ill have more gripes.

  12. NollieHeel
    Member
    Posted 5 months ago #

    So I guess next gripe is, is there a solution to not having to clear the browser cache after each time I view changes. the w3 totalcache plugin's a bit far fetched at this point?

  13. CrouchingBruin
    Member
    Posted 5 months ago #

    Which browser are you using? Have you tried hitting Ctrl-F5 to refresh your browser when you want to see changes?

    Yes, don't install any caching plugin until you are all done with your site design.

  14. NollieHeel
    Member
    Posted 5 months ago #

    IE 11.
    Nah Ill have to try that

Reply

You must log in to post.

About this Topic