Support » Themes and Templates » Css works sometimes; other times it doesn’t.

  • I searched the forum and FAQ, sorry, but I just don’t see this anywhere.

    I started making a WP theme from scratch and the CSS formatting is working on this code:

    <div class=”quote”><?php wp_quotes_random(); ?></div>

    .quote { font-family: verdana; }

    But it doesn’t work on this code:

    <div class=”menu”><?php wp_get_archives(‘type=monthly’); ?></div>

    .menu { font-family: verdana; }

    What am I doing wrong? Obviously, the browser can find the stylesheet. This happened to me on B2Evo also. Do I need to use “the loop” or something? If you need more info, just ask. I hate feeling like I did some small little thing wrong, but I checked the spelling, etc like 10 times 🙁

Viewing 13 replies - 1 through 13 (of 13 total)
  • Use The Loop? Uh, no.

    You might try:

    .menu ul li { font-family: verdana; }

    A lot of stylesheet formatting is sensitive to how HTML is nested, so sometimes you need to target your declaration for specific elements.

    I get what you’re saying but that doesn’t work.

    Well, a link would definitely help troubleshoot this…

    Man, I wish I could but Im hosting it on my computer and seeing as I have a dial-up modem with a dynamic IP address, it just wouldn’t work. I was planning to iron out all the kinks first and then build a real server after summer is over.

    Would a screenshot help?

    Not much. However, if you’re using a third-party theme, knowing which one may help us track down what’s needed here. If not, you could try pasting up the template and style.css to a site like:

    And reply back with a link to them.

    To keep things simple, I usually declare my font-family in the BODY element. And if I vary from it (for titles, etc.), then I declare them there, but I usually decide on my font family and size in BODY. And variations of each are declared. It just keeps things simple and keeps the styleseheet bloat down, too.

    But like Kafka mentioned, you do have to be careful when dealing with nested ordered/unordered lists, etc. If you declare font-weight bold in ul li, then it will be bold in ul li ul li unless you declare font-weight: normal. Does this make sense?

    Well, as I said before, I started making my own theme from scratch, using the default theme (Kubrick) as reference.

    Sure it makes sense, unfortunately it doesn’t help me, but I will consider that in the future.

    Here is the Style.css code on Pastebin:

    Here is the Index.php code on Pastebin:

    In your styles, it should be

    font-weight: normal;

    NOT “none”!

    The index.php file is tag soup! Lordy. I’ll take a peek and see if I can sort out the immediate problem. The rest is best left for another day, eh?

    Ick. Tables…

    The problem is an error in your css with the .quote declaration:

    .quote {
    font-family: verdana;
    color: #000000;
    font-size: 10px;
    font-weight: none;
    <– Joni’s complaint
    text-transform: uppercase;
    text-align: center;

    That should end with a closing curly bracket (}). As it’s not, its causing the following .menu element to fail.

    Holy crap, you’re right… I knew it was something small and stupid. My moniter is so bad right now I honestly cannot tell the difference between ‘)’ and ‘}’ unless I put my nose to the screen!

    Thanks a lot! I hope that good things happen to you.

    That’s what we have validators for as well…

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Css works sometimes; other times it doesn’t.’ is closed to new replies.