<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Coffee Cup</title>
<link rel="stylesheet" href="coffee.css">
</head>
<body>
<div class="cup-top"></div>
<div class="cup-body"></div>
<footer>
<p>Created by <a href="https://www.rembertdesigns.co/" target="_blank">Richard Rembert</a></p>
</footer>
</body>
</html>
*{
margin: 0;
padding: 0;
background-color: #ffad77;
}
body{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.cup-top{
position: relative;
width: 120px;
border-right: 15px solid transparent;
border-left: 15px solid transparent;
border-bottom: 40px solid #3a3a3a;
cursor: pointer;
transform-origin: left bottom;
transition: .5s;
}
.cup-top:hover{
transform: rotate(-20deg);
}
.cup-top::after{
content: "";
position: absolute;
bottom: -40px;
left: -30px;
width: 180px;
height: 15px;
background-color: #000;
border-radius: 5px;
}
.cup-body{
position: relative;
width: 120px;
border-right: 15px solid transparent;
border-left: 15px solid transparent;
border-top: 200px solid white;
z-index: -1;
}
.cup-body::before{
content: "";
position: absolute;
bottom: 60px;
left: -16px;
width: 136px;
border-right: 8px solid transparent;
border-left: 8px solid transparent;
border-top: 70px solid #936200;
}
footer {
position: relative;
padding: 10px;
top: 100px;
left: -60px;
background: white;
width: 100%;
font-size: 20px;
text-align: center;
color: #333;
}
footer a {
text-decoration: none;
color: #c63a3a;
}
footer a:hover {
text-decoration: underline;
color: #000
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.