17

bluebutton.css

.btnBlue button{
Styles go here
}

.btnBlue button::-moz-focus-inner{
Styles go here
}

.btnBlue button:hover,button:focus{
styles go here
}

.btnBlue button:active{
Styles go here
}

index.html

<!DOCTYPE html>
<html>
<head>
<title>Css buttons</title>
<link type='text/css' href='css/bluebutton.css' rel='stylesheet' media='screen' />
</head>
<body>
<button type="submit" class="btnBlue">Okay</button>
</div>
</body>
</html>

This does not seem to work. I know it works if i try to do it without the .btnBlue but i want to create different button styles. So like i can define for each button what style to use.

1 Answer 1

29

Think you need to change the stylesheet declarations here to:

button.btnBlue {
  /* Styles go here */
}

button::-moz-focus-inner.btnBlue {
  /* Styles go here */
}

button:hover.btnBlue,
button:focus.btnBlue {
  /* Styles go here */
}

button:active.btnBlue {
  /* Styles go here */
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.