영어윈도우즈
본문
<!DOCTYPE html>
<html>
<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>Current Time</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
width: 100%;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
position: relative;
overflow: hidden;
}
.container img {
width: 100%;
object-fit: cover;
}
#current-time {
position: absolute;
color: white;
font-size: 12rem;
}
</style>
</head>
<body>
<div class="container">
<img class="slide1" src="c:\\display/clock/hour_paper.jpg">
<h1 id="current-time"></h1>
</div>
<script>
const time = document.getElementById('current-time'); // id가 'current-time'인 요소
// 1초마다 현재 시각 업데이트
setInterval(() => {
const date = new Date(); // 새로운 Date 객체 생성
time.innerHTML = date.toLocaleTimeString();
}, 1000);
</script>
</body>
</html>