抖音羅盤時鐘代碼 CSS
抖音羅盤時鐘是抖音平臺上一種獨特的時鐘樣式,可以讓用戶在晚上查看時間時更加直觀和方便。下面是抖音羅盤時鐘的CSS代碼實現。
首先,我們需要在HTML中添加一個包含時鐘樣式的標簽。例如,我們可以在HTML中添加以下標簽:
接下來,我們需要在CSS中定義時鐘的樣式。我們可以使用以下CSS代碼:
.clock {
position: relative;
width: 300px;
height: 300px;
.clock .hour {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #e8e8e8;
transform: translateY(-50%);
.clock .hour:before {
content: "";
position: absolute;
bottom: 10px;
left: 50%;
width: 0;
height: 0;
border-left: 75px solid transparent;
border-right: 75px solid transparent;
border-bottom: 100px solid #e8e8e8;
transform: translateX(-50%);
.clock .hour:after {
content: "";
position: absolute;
bottom: 10px;
left: 25%;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 50px solid #e8e8e8;
transform: translateX(-25%);
.clock .hour a {
display: block;
text-align: center;
margin-bottom: 10px;
color: #333;
font-size: 16px;
text-decoration: none;
.clock .hour a:hover {
color: #fff;
background-color: #333;
.clock .minute {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #e8e8e8;
transform: translateY(-50%);
.clock .minute:before {
content: "";
position: absolute;
bottom: 5px;
left: 50%;
width: 0;
height: 0;
border-left: 75px solid transparent;
border-right: 75px solid transparent;
border-bottom: 100px solid #e8e8e8;
transform: translateX(-50%);
.clock .minute:after {
content: "";
position: absolute;
bottom: 5px;
left: 25%;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 50px solid #e8e8e8;
transform: translateX(-25%);
.clock .minute p {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
font-size: 14px;
color: #333;
margin-bottom: 20px;
.clock .hour, .clock .minute {
display: flex;
.clock .hour h1 {
font-size: 32px;
margin-bottom: 20px;
.clock .minute h1 {
font-size: 24px;
margin-bottom: 20px;
.clock .hour .title {
font-size: 24px;
margin-bottom: 30px;
.clock .minute .title {
font-size: 18px;
margin-bottom: 30px;
.clock.active {
background-color: #007bff;
以上就是抖音羅盤時鐘的CSS代碼實現,使用這些CSS代碼,用戶可以輕松查看抖音平臺上的時鐘,以及知道當前的時間。