• Resolved Freezecheese

    (@freezecheese)


    Hi there,

    I know this is a rookie question but I can’t figure it out.

    I want all the links in my posts and pages to be coloured but not underlined. Just as it is in my footer. I’m sure there is a way to do it through the custom CSS but I’m a newbie with html.

    After reading the help forums, I tried adding this to the bottom of /*– This is where the changes to the body are –*/ in the custom CSS:

    .post a {
    color: #98c1c3;
    text-decoration: none;
    }

    Which removed the underlines but failed to add the colour.

    I think at some point I must also have done something to my sidebar as it now appeared under my blog post instead of on the right!

    And help is appreciated.

    http://www.freezecheese.com/

Viewing 9 replies - 1 through 9 (of 9 total)
  • C W (VYSO)

    (@cyril-washbrook)

    Regarding your link problem, it’s because of this rule in your custom CSS:

    .entry .post-content a {
    color: #585858;
    font-family: Cambria;
    }

    A rule with a more specific selector prevails over a rule with a less specific selector. As .entry .post-content a is more specific than .post a, adding a rule for the latter does nothing.

    You should change the above rule to:

    .entry .post-content a {
    color: #98C1C3;
    text-decoration: none;
    }

    (The font-family declaration is unnecessary.)

    .post a {
    color: #98c1c3;
    text-decoration: none;
    }

    text-decoration is meant for other purposes that the <a> anchor. Please review the proper use of the CSS (not to be confused with HTML) of this:

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

    C W (VYSO)

    (@cyril-washbrook)

    The reason your sidebar is below the content is because some div layers are missing a closing </div> tag. This means that your sidebar is being nested inside your post/comments area instead of sitting separately. If you’ve been editing your templates at all lately, you may have accidentally deleted or misplaced some </div> tags.

    Thread Starter Freezecheese

    (@freezecheese)

    Thanks so much, Cyril! That looks fantastic. Really appreciated 🙂

    Regarding the </div> tags, I haven’t made any changes to the template (that I know of), I have only fiddled around with the Custom CSS.

    How can I fix my sidebar issue?

    C W (VYSO)

    (@cyril-washbrook)

    In your posts, you have loads of unclosed elements like this:

    <div style="text-align: left;">

    All of your posts seem to start off that way (they shouldn’t – such an element is redundant), but the opening tag is never closed. Similarly, whenever you have a captioned image in your post, the caption is prefaced with <div style="text-align: center;">, but the opening tag is never closed.

    I don’t know how those elements got there or why they aren’t closed, but they are the reason why (1) your sidebar isn’t appearing in the right place and (2) the comments on your posts aren’t being formatted correctly. If the problem only appeared recently, and you didn’t put in those elements yourself, then you need to think carefully back to whether you installed any plugins or made any changes to your template files.

    Thread Starter Freezecheese

    (@freezecheese)

    Okay, that makes sense. I do start my posts off that way, the reason being is another CSS issue I can’t figure out, why my posts are stubbornly sans serif when I want them all to be serif (Cambria font).

    I thought I had made everything serif in the custom CSS but it doesn’t seem to apply to my posts. Inserting <div style=”text-align: left;”> is the only way I’ve been able to change the font.

    C W (VYSO)

    (@cyril-washbrook)

    If you set the following rule:

    .post-content p {
    font-family: Cambria;
    }

    … that should ensure your posts are formatted in the serif typeface. The reason is that although you have set the typeface for .post-content to Cambria, ordinary text in WordPress posts is by default organised into paragraphs through <p></p> tags. The default font for all <p></p> elements is Open Sans. Hence the sans-serif.

    ———————

    For general reference, whenever you put in a tag like <div>, you must close the element with a corresponding </div> tag where you want it to end. Otherwise, browsers just don’t know for sure where layout elements start and end.

    This goes for the way you are currently doing captions: you have <div style="text-align: center;"> on all of these elements, but you never close these at the end of the caption. (In my view, it’s better in any case to use WordPress’s built-in caption function.)

    Thread Starter Freezecheese

    (@freezecheese)

    Thanks, I’ve changed that now and it looks great! I’ll start deleting all my unnecessary div styles. Cheers

    Thread Starter Freezecheese

    (@freezecheese)

    Thanks all

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Post links coloured not underlined’ is closed to new replies.