13 - CSS3 - 邊框圓角 - 鐘表


本文是針對(duì)剛學(xué)編程的小白,都是一些基礎(chǔ)知識(shí),如果想了解更多深層一點(diǎn)的東西,歡迎移步本人博客!!
博客地址 點(diǎn)擊跳轉(zhuǎn)


< ! ---------- HTML ----------- >

<div class="clock">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div class="cover"></div>
    <div class="hour"></div>
    <div class="minute"></div>
    <div class="second"></div>
    <div class="dot"></div>
</div>

< ! --------- Style --------------- >

<style>
    *{
        margin: 0;
        padding: 0;
    }
    .clock{
        width: 400px;
        height: 400px;
        margin: 100px auto;
        border: 10px solid #000;
        box-sizing: border-box;
        border-radius: 50%;
        position: relative;
    }
    .clock div{
        width: 8px;
        height: 380px;
        background-color: #ccc;
        position: absolute;
        left: 50%;
        margin-left:-4px;
    }
    .clock div:nth-child(1){
        width: 14px;
        margin-left:-7px;
    }
    .clock div:nth-child(2){
        transform: rotateZ(30deg);
    }
    .clock div:nth-child(3){
        transform: rotateZ(60deg);
    }
    .clock div:nth-child(4){
        transform: rotateZ(90deg);
        width: 14px;
        margin-left:-7px;
    }
    .clock div:nth-child(5){
        transform: rotateZ(120deg);
    }
    .clock div:nth-child(6){
        transform: rotateZ(150deg);
    }
    .clock .cover{
        width: 320px;
        height: 320px;
        background-color: white;
        border-radius: 50%;
        margin-left:-160px;
        top: 50%;
        margin-top:-160px;
    }
    .clock .hour{
        width: 20px;
        height: 100px;
        background-color: black;
        margin-left:-10px;
        top: 100px;
        animation: sport 43200s linear 0s infinite normal;
    }
    .clock .minute{
        width: 14px;
        height: 120px;
        background-color: black;
        margin-left:-7px;
        top: 80px;
        animation: sport 3600s linear 0s infinite normal;
    }
    .clock .second{
        width: 10px;
        height: 150px;
        background-color: red;
        margin-left:-5px;
        top: 50px;
        animation: sport 60s steps(60) 0s infinite normal;
    }
    .clock .dot{
        width: 30px;
        height: 30px;
        background-color: black;
        border-radius: 50%;
        margin-left:-15px;
        top: 50%;
        margin-top:-15px;
    }
    @keyframes sport {
        from{
            transform: rotateZ(0deg);
            transform-origin: center bottom;
        }
        to{
            transform: rotateZ(360deg);
            transform-origin: center bottom;

        }
    }
</style>

< ! --------- 效果展示 ---------- >

**鐘表**
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容

  • Android 自定義View的各種姿勢(shì)1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 173,455評(píng)論 25 708
  • 曽奇峰:精神分析基礎(chǔ)課之25、26 1. 在科胡特的疾病分類學(xué)里面,自戀的精神病病理學(xué)包括以下四種類型: (1)人...
    皮皮爸爸時(shí)代閱讀 509評(píng)論 0 0
  • 山林里的雨是奇幻無窮的,草原上的雨是豪邁清爽的,都市里的雨是綿綿思情的,而池塘上的雨又是別有情趣的,讓我?guī)?..
    干凡凡閱讀 384評(píng)論 0 1
  • 我的祈禱: 愿世上的每一個(gè)人都享有輕而易舉的豐盛! 擁有全然的健康、充滿愛的關(guān)系,經(jīng)濟(jì)的獨(dú)立,富裕和自由的生活! ...
    點(diǎn)滴XY閱讀 392評(píng)論 0 0
  • 碗子仿席勒~~畫畫不是爭(zhēng)強(qiáng)斗狠,好不好心中自有一桿秤,一百個(gè)人有一百個(gè)說法,己娛便好。[咖啡]
    瘦人碗子閱讀 318評(píng)論 0 1