
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
아무리 코드수정해달라해도
탑버튼이 작동을 안해요!
최상단으로 이동하지않아요~
보고 계신 화면 전체를 캡처해 주시면, 튜터님들이 빠르게 상황을 이해할 수 있어요.
작성한 코드 및 에러 메세지
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Floating Button</title>
<style>
body {
height: 2000px; /* 페이지 길이 추가 */
}
.floating-button {
position: fixed;
bottom: 80px;
right: 20px;
width: 60px;
height: 60px;
background-color: #007bff;
color: white;
border: none;
border-radius: 50%;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
cursor: pointer;
font-size: 24px;
display: flex;
align-items: center;
justify-content: center;
transition: background-color 0.3s ease, transform 0.3s ease;
z-index: 1000;
}
.floating-button:hover {
background-color: #0056b3;
transform: scale(1.1);
}
@media (max-width: 768px) {
.floating-button {
width: 50px;
height: 50px;
font-size: 20px;
}
}
</style>
</head>
<body>
<button id="topButton" class="floating-button">▲</button>
</body>
</html>
