Hoverable Button Code
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="STYLESHEET"type="text/css"href="web.css">
<title>web design</title>
</head>
<body>
<h1>Hoverable Button</h1>
<button class="button button1">Green</button>
<button class="button button2">Blue</button>
<button class="button button3">Red</button>
<button class="button button4">Gray</button>
<button class="button button5">Black</button>
</body>
</html>
CSS Hoverable Button
.button{
background-color: green;
border: none;
color: #fff;
padding:15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin:4px 2px;
cursor: pointer;
}
.button1{
background-color: white;
color: #000;
border: 2px solid green;
}
.button1:hover{
background-color: green;
color: #fff;
}
.button2{
background-color: white;
color: #000;
border: 2px solid blue;
}
.button2:hover{
background-color: blue;
color: #fff;
}
.button3{
background-color: white;
color: #000;
border:2px solid red ;
}
.button3:hover{
background-color: red;
color: #fff;
}
.button4{
background-color: white;
color: #000;
border: 2px solid gray;
}
.button4:hover{
background-color: gray;
color: #fff;
}
.button5{
background-color: white;
color: #000;
border: 2px solid black;
}
.button5:hover{
background-color: black;
color: #fff;
}
No comments:
Post a Comment