WordPress.org

Ready to get started?Download WordPress

Forums

Css works sometimes; other times it doesn't. (14 posts)

  1. saynt
    Member
    Posted 8 years ago #

    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 :(

  2. Kafkaesqui

    Posted 8 years ago #

    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.

  3. saynt
    Member
    Posted 8 years ago #

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

  4. Kafkaesqui

    Posted 8 years ago #

    Well, a link would definitely help troubleshoot this...

  5. saynt
    Member
    Posted 8 years ago #

    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.

  6. masquerade
    Member
    Posted 8 years ago #


  7. saynt
    Member
    Posted 8 years ago #

    Would a screenshot help?

  8. Kafkaesqui

    Posted 8 years ago #

    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:

    http://pastebin.com

    And reply back with a link to them.

  9. Joni
    Member
    Posted 8 years ago #

    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?

  10. saynt
    Member
    Posted 8 years ago #

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

    Joni:
    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:
    http://pastebin.com/332527

    Here is the Index.php code on Pastebin:
    http://pastebin.com/332532

  11. Joni
    Member
    Posted 8 years ago #

    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?

  12. Kafkaesqui

    Posted 8 years ago #

    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.

  13. saynt
    Member
    Posted 8 years ago #

    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.

  14. Yngwin
    Member
    Posted 8 years ago #

    That's what we have validators for as well...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.