- 1
How to change color of button?
3 Answers
+ 2
...set changes for tag specifically..
/* HTML */
<button>click</button>
/* CSS */
button {
color: #3388ff;
background-color: green;
}
...set changes for button via id
/* HTML */
<button id="#button>click</button>
/* CSS */
#button {
color: #3388ff;
background-color: green;
}
...set changes for button via class
/* HTML */
<button class="button">click</button>
/* CSS */
.button {
color: #3388ff;
background-color: green;
}
put the CSS in a style tag and use the html in body..
u can add extra properties or attributes e.g borders, padding, margin e.t.c..
+ 1
with css:
.customButton {
background-color: red;
}
+ 1
<input type="button" style="background-color:#0000ff;color: #fff;border-radius: 25px;" value="submit">
if you use button as a tag
<button type="button" style="background-color:#0000ff;color: #fff;border-radius: 25px;" onclick="alert ('Hello inline styling')" > Submit</button>