0

My code so far allows me to click on a button with rounded edges as I have applied the border-radius feature. However, when I click on the button the borer is still squared and so looks horribly out of sync.

Can be seen here:

http://www.tiikoni.com/tis/view/image.php?id=23d3264

this is the css for the button:

.submitToDoButton {
    background: lightgray;
    font-size: 20px;
    color: red;
    padding: 2px;
    width: 100px;
    border-radius: 25px;
}

this is what I thought would be the code to change the border aka set it to the same radius:

.submitToDoButton:active{
    border-radius: 25px;
}

but this does nothing

Wavemaster
  • 1,794
  • 16
  • 27
The Hurricane
  • 199
  • 2
  • 14
  • Questions seeking code help must include the shortest code necessary to reproduce it **in the question itself**. Although you have provided a link to an example, if the link were to become invalid, your question would be of no value to other future SO users with the same problem. – Paulie_D Nov 26 '15 at 13:32
  • This image will be offline in a day. Please add the code to the question. – Wavemaster Nov 26 '15 at 13:38
  • Skip the whole `:active` rule and add `outline: none` to the main class. – Asons Nov 26 '15 at 13:40
  • http://stackoverflow.com/questions/1418766/changing-color-of-rounded-corners-button-with-css Go through this stackoverflow links will help u – Upendrasinh Jadeja Nov 26 '15 at 13:50

2 Answers2

2

You could try outline: none; to the main button class:

.submitToDoButton{
    border-radius: 25px;
    outline: none; /* add this */
}

If you do want an effect similar to outline but to look good, you can use the box-shadow property.

Wavemaster
  • 1,794
  • 16
  • 27
0

You won't be able to solve this with border-radius and outline. To get the result you are looking for you need to make a box-shadow looking the same as the outline on :focus.

.submitToDobutton:focus {
     box-shadow: 0 0 5px blue;
}

I am not sure about the outline color, but you'll probably have to change 'blue' to the correct color.