WordPress.org

Ready to get started?Download WordPress

Forums

Tempera
Hover button, background same color, text color changes on hover (3 posts)

  1. Billy2209
    Member
    Posted 1 month ago #

    I am trying to make a button with a green background. The text would change color on hover (background stays the same, only the text color changes). I tried the code below but it does not work :-(.

    In the Tempera Theme Custom CSS:
    .greenbutton {
    font-family:"Trebuchet MS", Helvetica, sans-serif;
    background: #82B607;
    font-size: 20px;
    display: block;
    width: 250px;
    text-decoration: none;
    padding: 10px;
    }
    .greenbutton a {
    color: white;
    }
    .greenbutton:hover a {
    color: #e619d5;
    }

    In the page html:
    <div class="greenbutton"><center><a href="https://www.......com" target="_blank">my text</a></center></div>

  2. theZedt
    Member
    Posted 1 month ago #

    Place the greenbutton class on the a, not the div and adjust the CSS accordingly.

  3. Billy2209
    Member
    Posted 1 month ago #

    Ok like <a class="greenbutton"....

Reply

You must log in to post.

About this Theme

About this Topic