Skip to content

Instantly share code, notes, and snippets.

@coman3
Last active April 29, 2019 04:19
Show Gist options
  • Save coman3/464275500bb99e99ed9b68039d5cbd49 to your computer and use it in GitHub Desktop.
Save coman3/464275500bb99e99ed9b68039d5cbd49 to your computer and use it in GitHub Desktop.
<!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>Document</title>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="center">
<!-- Content here -->
</div>
</div>
<script src="scripts.js"></script>
</body>
</html>
// Your Javascript goes here
var button = document.getElementById("{button ID here}");
button.onclick = ourButtonClick;
function ourButtonClick() {
alert("test");
}
* {
box-sizing: border-box;
}
html,
body {
height: 100%;
margin: 0;
padding: 10% 0;
}
.container {
width: 50%;
margin: auto;
padding: 0;
height: 100%;
background: #f1f1f1;
}
.container .center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
.container button {
width: 100%;
height: 50px;
font-size: 16px;
background-color: green;
color: white;
border: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment