Skip to content

Instantly share code, notes, and snippets.

@matthieua
Created March 29, 2020 18:16
Show Gist options
  • Save matthieua/1ee5a60dcfd4850cf40d0efeff45c64d to your computer and use it in GitHub Desktop.
Save matthieua/1ee5a60dcfd4850cf40d0efeff45c64d to your computer and use it in GitHub Desktop.
<html>
<head>
<style>
h1 {
text-align: center;
color: blueviolet;
}
h2 {
text-align: center;
border: 1px solid blueviolet;
border-radius: 10px;
padding: 20px;
}
img {
border-radius: 10px;
display: block;
margin: 0 auto;
max-width: 400px;
}
p {
line-height: 1.5;
}
.container {
margin: 60px;
}
button {
display: block;
margin: 20px auto;
background: blueviolet;
color: white;
font-size: 20px;
padding: 20px 30px;
border-radius: 30px;
border: none;
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.4);
}
button:hover {
cursor: pointer;
opacity: 0.8;
}
</style>
</head>
<body>
<div class="container">
<h1>
Bachata
</h1>
<h2>
Dance
</h2>
<img
src="https://i.pinimg.com/564x/26/92/58/26925804e1ff3b56057476e267c8499c.jpg"
alt=""
/>
<p>
Bachata is a style of social dance from the Dominican Republic which is
now danced all over the world. It is connected with bachata music.
</p>
<a href="https://en.wikipedia.org/wiki/Bachata_(dance)" target="_blank">
Learn more on Wikipedia
</a>
<button>
Subscribe to our newsletter
</button>
</div>
<script>
function subscribe() {
let firstName = prompt("What is your first name?");
let email = prompt("What is your email?");
alert(`Thank you ${firstName}, we'll be in touch!`);
}
let button = document.querySelector("button");
button.addEventListener("click", subscribe);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment