soyaine/JavaScript30

02 - JS + CSS Clock 细节 布局问题

Closed this issue · 1 comments

.clock-face {
        position: relative;
        width: 100%;
        height: 100%;
        transform: translateY(-3px); /* account for the height of the clock hands */
}

transform: translateY(-3px); 应该删除,此处是hand指针高度为6px时,使其居中
而你的分别为时分秒设定不同的高度,并通过margin-top:-height/2 使其居中了

Thank you.