WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wee header style problem! help! (4 posts)

  1. dominoeffect
    Member
    Posted 6 years ago #

    Hi all,

    Just wondering if anyone can assume why this code wouldn't produce links which are 777888 in color?!

    <h5 style="font-family:Georgia, Times New Roman, Times, serif; a color: #777888; text-decoration:none; border-bottom:1px;"><?php the_category(' & ') ?></h5>

    Appreciate any help,

    Best

  2. drewactual
    Member
    Posted 6 years ago #

    links do wonders....

    but it appears to me off the bat, that you are placing in a h5 a call to a WP function which by itself will place the item in a field already controlled by a style (via external css)...

    in other words you will get your item displayed, but it will be displayed in an h5 parent container and contained in another element.. just my thoughts without a link.. there is no reason I can come up with that the category would appear not #777888 otherwise.

  3. dominoeffect
    Member
    Posted 6 years ago #

    Do you mean because the h5 style is already define in the stylesheet it may simply overwrite the <h5 style=...> definitions? I suspected that could be happening.

    Anyway I managed to sort it in another way, it isn't relevant and would just be confusing to read about, so I'll keep it to myself!

    Thank you for the help Drewactual!

  4. drewactual
    Member
    Posted 6 years ago #

    well, I often refer to css as akin to a private in the Army- it will do EXACTLY what you LAST told it to do.. sorta like this:

    margin-top:5px;
    margin:0px;

    will give you a margin of 0px all around your element. But:

    margin: 0px;
    margin-top:5px;

    will give you what you are looking for, 0px around everything except the top, which will be 5px. This causes lots of folks issues.

    As far as yours, you would be defining the style in the call, on your theme- but your theme is going to use an external stylesheet to control the layout.. which comes last? The stylesheet rules or the call rules? debatable I would reckon... But I think the HTML or PHP call trumps the external stylesheet... but if you are calling something via WP function, that function may have embedded a tag which WILL look for external styles defined- so it would look like this:

    <h5 style="color:#ccc;"><h5> your text which external css got a hold of </h5></h5>

    I don't know if that is the case, I am just speculating it could be the cause... It is something I think I will play with to learn more about..

Topic Closed

This topic has been closed to new replies.

About this Topic