JS Hello World
step2
by shahryar saljoughi
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Step2 Task number 3</title>
</head>
<body>
<div id="btn" onclick="sayHello()">
Don't Resists, You Want JS <br>
<span style="font-size: small;">and you know it</span>
</div>
</body>
</html>
CSS
body {
background-color: brown;
}
#btn {
position: absolute;
max-width: 20%;
padding: 60px;
text-align: center;
color: black;
background: rgba(204, 204, 204, 0.5);
/* opacity: 0.3; */
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
font-family: cursive;
font-weight: bold;
border-radius: 15%;
}
#btn:hover{
box-shadow:
10px 10px 5px rgb(116, 28, 32),
-10px -10px 5px rgb(116, 28, 32);
cursor: pointer;
}
JavaScript
function sayHello() {
alert("Hello World!");
}