I am trying to change the color of the text inside the button on hover.
I can make the button itself change color, but I want the button text to change color too.
The CSS property color
controls the text color in elements generically. In your case, to change the color on hover, use the :hover
specifier;
input[type = "submit"]:hover {
color: #FF0000;
//you can add more styles to be applied on hover
}
Note that you can as well specify the color using the rgb(x, y, z)
format. Here's a little demo to illustrate: little link. You can play around with the demo and view the source here: another little link.
I hope that helped!
If you want to change the color of the text, use the CSS color
property, like
input[type="submit"]:hover{
color :#E6D332;
}
color:#(insert text color)
Put this in
p.one{
color: DarkBlue}
p.one:hover{
color: yellow}
<html>
<head>
<title>Css Help</title>
<head>
<body>
<p class="one">Example TextExample TextExample TextExample TextExample TextExample TextExample TextExample TextExample TextExample TextExample TextExample TextExample TextExample TextExample TextExample TextExample TextExample Text<p>
</body>
<html>
Here is what I do:
a:hover{
color: #ffffff;
}
You can change the 'a' to whatever such as a paragraph 'p' or specify it the html file with a class
<p class="one">Example</p>
Them in CSS file do:
p.one:hover{
color: #ffffff;
}
I hope I could Help.