div+js实现数字时钟显示当前时间与星期代码
代码语言:html
所属分类:其他
代码描述:div+js实现数字时钟显示当前时间与星期代码
代码标签: div js 数字 时钟 显示 当前 时间 星期 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url('https://fonts.googleapis.com/css?family=Montserrat:300,400,500'); :root { --background: #2ecc71; --containerDark: #010101; --textColor: #f4f4f4; --labelColor: #cccccc; --shadow: #030303; } *, *::after, *::before { margin: 0; padding: 0; box-sizing: border-box; } html { font-size: 62.5%; font-family: 'Montserrat', sans-serif; font-weight: 300; line-height: 1rem; letter-spacing: .08rem; } body { display: flex; justify-content: center; align-items: center; font-size: 1.4rem; font-weight: inherit; background-color: var(--background); height: 100vh; width: 100vw; } .container { position: relative; display: flex; flex-direction: row; justify-content: center; align-items: center; height: 20rem; width: 60rem; background-color: var(--containerDark); border-radius: 3px; box-shadow: 2px 2px 20px var(--shadow); } .clock-column { margin-right: 7rem; text-align: center; } .clock-column:last-child { margin-right: 0; } .clock-column::before { content: ''; display: block; height: .25rem; width: .25rem; border-radius: 3px; background-color: var(--labelColor); position: absolute; top: 85px; left: 160px; } .clock-column::after { content: ''; display: block; height: .25rem; width: .25rem; border-radius: 3px; background-color: var(--labelColor); position: absolute; top: 100px; left: 160px; } .clock-column:nth-child(2)::before { content: ''; display: block; height: .25rem; width: .25rem; border-radius: 3px; background-color: var(--labelColor); position: absolute; top: 85px; left: 286px; } .clock-column:nth-child(2)::after { content: ''; display: block; height: .25rem; width: .25rem; border-radius: 3px; background-color: var(--labelColor); position: absolute; top: 100px; left: 286px; } .clock-column:nth-child(3)::before { content: ''; display: block; height: .25rem; width: .25rem; border-radius: 3px; background-color: var(--labelColor); position: absolute; top: 85px; left: 419px; } .clock-column:nth-child(3)::after { content: ''; display: block; height: .25rem; width: .25rem; border-radius: 3px; background-color: var(--labelColor); position: absolute; top: 100px; left: 419px; } .clock-label { padding-top: 2.2rem; text-transform: uppercase; color: var(-.........完整代码请登录后点击上方下载按钮下载查看
网友评论0