Demon
Demon

Reputation: 13

Stylizing button with class reference does'nt work

I'm trying to recreate famous buttons, but when I style a single button using its class it doesn't style

button {
  color: blue;
  outline: none;
  border: none;
}

.yt button {
  color: red;
  outline: none;
  border: none;
}
<button class="yt">Subscribe</button>
<button class="join">Join</button>
<button class="tweet">Tweet</button>

Image of Buttons:

Upvotes: 0

Views: 37

Answers (1)

Jaswinder Kaur
Jaswinder Kaur

Reputation: 1634

Use button.yt

button {
    color: blue;
    outline: none;
    border: none;
}

button.yt{
    color: red;
    outline: none;
    border: none;
}
<!DOCTYPE HTML>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>
<body>
    <button class="yt">Subscribe</button>
    <button class="join">Join</button>
    <button class="tweet">Tweet</button>
</body>
</html>

Upvotes: 3

Related Questions