If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Oct 2014
    Member #

    Trouble making dynamic button link change with mouse state

    I have a link button that I want to have change colour in hover and active mouse states. However, the link is set inside a <div> tag which changes shape reactively when the window is resized, but only the <a> tag responds to the hover and active states. Can anyone explain how I can make my whole button change with the mouse state and not just the <a> element? Alternatively, how can I code for the <a> tag so that it forms a tidy button with corner radius that changes shape reactively when the window is resized?

    Thanks in advance.

    These are the lines of CSS code I'm using.

    div.button {
    text-align: center;
    margin-bottom: 30px;
    padding: 10px 20px 10px 20px;
    background: #ff7700;
    border-radius: 20px;
    -moz-border-radius: 20px;
    -webkit-border-radius: 20px;
    box-shadow: 0px 2px 1px 1px #333333;

    a:link.button {
    font-family:gill sans, arial, sans-serif;
    font-style: italic;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 2px 1px #000000;
    a:hover.button {
    background: #ff9933;
    color: #eeeeee;


  3. #2
    Senior Member sasha_bolcina's Avatar
    Join Date
    Sep 2014
    Member #
    47 times
    :hover is supported on any tag. Only older browsers and IE are problematic.
    However, you can put in a:link.button everything you have in div.button. And add display: block.

  4. #3
    Junior Member
    Join Date
    Oct 2014
    Member #
    Wow... Awesome! Thanks!!

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 06:42 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: