Home > Back-end >  Stylizing button with class reference does'nt work
Stylizing button with class reference does'nt work

Time:07-06

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 >Subscribe</button>
<button >Join</button>
<button >Tweet</button>

CodePudding user response:

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 >Subscribe</button>
    <button >Join</button>
    <button >Tweet</button>
</body>
</html>

  • Related