changing default color of hyperlinks and background using css

  • Unknown's avatar

    Greeting community. I’m new. I’ve tried to customize a page with some CSS code (below).

    The table is working as expected. However the background is not lightblue and only one href is red, as I have several a href tags in the content of the table. This is unexpected. The goal is to change this single page (not the entire background). I’ve also tried adding <body bgcolor=”lightblue”> on the page, but the theme does not recognize the body tag and overwrites it when I go to visual. (yes I remembered to </body> at the end of the table code.

    Any help is welcome. Thank you.

    The webpage is here: https://bffalliance.org/activities/

    <style>
    body {
    background-color: lightblue;
    }
    a {color:red;
    }
    table {
    font-family: arial, sans-serif;
    border-collapse: collapse;
    width: 100%;
    }
    td, th {
    border: 1px solid #dddddd;
    text-align: left;
    padding: 8px;

    }
    tr:nth-child(even) {
    background-color: #dddddd;
    }
    </style>

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    I was able to colorize the hyperlinks with the code below. However I still can’t change the color of the page (I want to keep the background as is, I only want to color the page). Thank you in advance for any help you can give.

    a:link {
    color: red;
    }
    a:visited {
    color: red;
    }
    /*a:hover {
    color: hotpink;
    }
    a:active {
    color: blue;
    }

  • Unknown's avatar

    Hi @bffalliance,

    Do you want to change the background colour for all pages on your site or only this specific one?

    If you’re only try to change the colour of this specific page, then give the following custom CSS a try:

    .page-id-251 .article-wrapper {
        background: lightblue;
    }

    Let me know if that works as you’d like it to. :)

  • Unknown's avatar

    Worked perfectly!
    Thank you kindly

  • Unknown's avatar

    Hurray! You’re most welcome. :)

  • The topic ‘changing default color of hyperlinks and background using css’ is closed to new replies.