WordPress.org

Ready to get started?Download WordPress

Forums

Extra CSS code is coming from somewhere? (8 posts)

  1. Alto Refugio
    Member
    Posted 1 year ago #

    I am trying to implement a tree diagram like the one in this tutorial. I pasted the CSS code from the tutorial at the bottom of my theme's style.css file. It works in that it makes a tree. The problem is that the alignment is off; on my site it looks like this screenshot. Here's the boggling part: When I paste the entire text of the modified style.css and the HTML document into files on my own computer (linking the two files of course), the tree shows up correctly, exactly as in the tutorial. I assume that some stray CSS code is coming from somewhere and causing the alignment error, but I don't know from where.

    My theme is Aggregate. In addition to style.css it has four other tiny CSS files, but they do nothing except change the colors of things, and in the theme settings, they are inactive.

    Any ideas?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Try using Firefox with the Firebug add-on for this kind of CSS troubleshooting. Or use whatever developer tool is available in your web browser.

  3. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Yes to the above, beyond that, without a link to a page with a live example of this, no way to help with it.

  4. Alto Refugio
    Member
    Posted 1 year ago #

    OK, I didn't post a link because I didn't know how to make the page public without a link showing up on my homepage, but I found a way. It's here. For some reason it's a little more spaced out now, but still misaligned.

    A general question is: Where might extra CSS code be coming from?

  5. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Without a link to a page demonstrating the problem, we cannot help.

  6. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    If you use Firebug, you will immediately see all the CSS affecting that element - for example, it shows this (from the theme's style.css file:

    .post ul li ul, .post ul li ol, .comment-content ul li ul, .comment-content ul li ol {
        padding: 2px 0 2px 20px;
    }
  7. Alto Refugio
    Member
    Posted 1 year ago #

    OK, Firebug is very helpful. Apparently my site has lots of CSS code that's not from style.css. Is it normal for the theme's PHP files to generate additional CSS code?

    I'll have to do some research about how cascading works in order to solve this. Thanks for your help!

  8. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    theme's PHP files to generate additional CSS code?

    No, but it's not unusual for a theme to have more than one stylesheet. Plugins can add styles as well.

    Yes, learning basic CSS will be helpful - this is a good reference site:

    http://www.w3schools.com/css/

Topic Closed

This topic has been closed to new replies.

About this Topic