<!DOCTYPE html>
<html lang="en">
<head>
<link href='E:\html\testpro\style.css' rel='stylesheet'>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Orbitron&display=swap" rel="stylesheet"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>clock</title>
</head>
<body>
<div class="container">
<h2>digital clock</h2>
<div class="clock">
<p id='time'></p>
</div>
</div>
<script src='E:\html\testpro\script.js' rel='text/js'></script>
</body>
</html>
#css code==>>
body{
margin: 0;
padding: 0;
/* background-color: #000; */
background-color: #022f4d;
}
.container{
position: absolute;
top: 10%;
}
.clock{
position: relative;
width: 500px;
height: 130px;
border: 2px solid #00ffff;
border-radius: 10px;
margin: 20px;
padding: 10px;
top: 20%;
left: 10%;
-webkit-box-reflect: below 10px linear-gradient(transparent, transparent, rgba(0,0,0,0.4));
box-shadow: 0 0 5px 3px #00ffff;
}
.clock p{
font-family: 'Orbitron', sans-serif;
font-size: 3em;
text-align: center;
color: #00ffff;
text-shadow: 0 0 5px #00ffff;
}
h2{
position: relative;
font-family: 'Orbitron', sans-serif;
color: #00ffff;
text-transform: uppercase;
letter-spacing: 2px;
margin: 20px;
text-shadow: 0 0 5px #00ffff;
font-size: 2em;
left: 29%;
}
#js code==>>
var time = setInterval(time, 1000);
function time(){
let date= new Date();
let time = date.toLocaleTimeString();
document.getElementById('time').innerHTML = time;
}
Code for Analog Clock: click here
Comments
Post a Comment