user2950895
user2950895

Reputation: 27

Changing the colour of a button

I'm having problems in order to change the colour of this button. This is the code:

<div class = "Petrol">
   <a href="PayMethod.php"><button class="btn btn-default btn-lg" type="button"><span class="Text">Petrol<br><small>(Hi-Grade)</small></span></button>
   </a>
</div>

Can you please help me?

Upvotes: 0

Views: 27783

Answers (3)

musafar006
musafar006

Reputation: 999

Assuming by the classes you used, I think you are using Bootstrap. Bootstrap provide pre-defined classes to change bg color of buttons. Replace btn-default by any of the following to get a different color. btn-primary, btn-success, btn-info, btn-warning, btn-danger, and btn-link. Take a look at the docs.

You could also apply a custom class btn-custom and style it.

.btn-custom {
  background: #ff0; /* use your color here */
}

Upvotes: 4

Ashish
Ashish

Reputation: 429

if you need to change the color of the button do this:

 .btn {
      background-color:blue;
    }

if you need to change the text inside the color of the button

.btn {
      color:red;
    }

Upvotes: 4

Antonio Smoljan
Antonio Smoljan

Reputation: 2207

Straightfoward way works fine

.btn {
  color:blue;
} 

Example

Upvotes: 3

Related Questions