day09

A我今天學習到了什么

1溫習day08的知識點

1.公共樣式的提取
樣式文件,分層:
1.1  base:底層樣式,
      a.樣式重置,
      b.封裝的樣式,像浮動,偽元素清除浮動,定位,居中,寬度,偽元素設(shè)置邊框等;
//就是將常用的樣式進行自己的一個封裝,從而簡化代碼
1.2  common:公共樣式,一個項目中共同使用的樣式,比如色調(diào)等;
//單個項目組多次運用的樣式,組合
1.3  page:就是每個頁面使用的樣式,在其他的頁面不使用的樣式;
(參考bootstraps)
2.css 2d轉(zhuǎn)換(transform)
transform:translate(x,y) rotate(30deg)
2.1 位移:translate(x,y)  
//translateX,translateY同理
2.2 旋轉(zhuǎn): rotate(30deg)
2.3 傾斜:skew(x,y)
2.4縮放:scale(x,y)
//X,Y值設(shè)置一個則默認為兩個值一樣,同理
3、垂直水平居中
垂直水平居中margin:auto
//HTML
<div class="one">
    <div class="two">

    </div>
</div>
//css
.one{
            width:400px;
            height:400px;
            background-color: red;
            position: relative;
        }
        .two{
            width:100px;
            height:100px;
            background-color: pink;
            position: absolute;
            margin:auto;
            left:0;
            top:0;
            bottom:0;
            right:0;}
垂直水平居中margin:left/right
 position: absolute;
            margin-left:-50%width;
            margin-top:-50%height;
            left:50%;
            top:50%;
垂直水平居中transform:translate(x,y)
position: absolute;
            top:50% ;
            left:50%;
            transform:translate(-50%,-50%)
4.過渡(transition)
代碼如下:
<style>
        div{
            background: #333;
            height: 200px;
            width: 200px;
        }
        .box:hover{
            transform: translateX(100px) rotate(360deg);
            background: pink;
            transition: all 2s linear 2s;
            /*屬性 動作需要時間 過渡的效果 延遲時間*/
        }
    </style>
</head>
<body>
    <div class="box">
    </div>
</body>

2.拓展day09的知識點

1、動畫animation
1.定義@keyframes 

A.@keyframes myfirst
{
    from {background: red;}
    to {background: yellow;}
}
div{
 animation:myfirst 2s;
}
B.@keyframes myfirst
{
    0%   {background: red;}
    25%  {background: yellow;}
    50%  {background: blue;}
    100% {background: green;}
}
div{
 animation:myfirst 2s infinite;  //無限循環(huán)
}
//css
 div{
            width: 100px;height: 100px;
            background: red;
            animation: myFirst 4S infinite;
        }
        @keyframes myFirst {
            0%{
                width: 200px;
                height: 200px;
            }
            25%{
                width: 100px;
                height: 50px;
            }
            50%{
                width: 400px;
                height: 200px;
            }
            100%{
                width: 200px;
                height: 400px;
            }
        }
// infinite:無限循環(huán)

B我掌握了的

1、動畫animation
1.定義@keyframes 

A.@keyframes myfirst
{
    from {background: red;}
    to {background: yellow;}
}
div{
 animation:myfirst 2s;
}
B.@keyframes myfirst
{
    0%   {background: red;}
    25%  {background: yellow;}
    50%  {background: blue;}
    100% {background: green;}
}
div{
 animation:myfirst 2s infinite;  //無限循環(huán)
}
//css
 div{
            width: 100px;height: 100px;
            background: red;
            animation: myFirst 4S infinite;
        }
        @keyframes myFirst {
            0%{
                width: 200px;
                height: 200px;
            }
            25%{
                width: 100px;
                height: 50px;
            }
            50%{
                width: 400px;
                height: 200px;
            }
            100%{
                width: 200px;
                height: 400px;
            }
        }
// infinite:無限循環(huán)

C我沒掌握的

沒怎么去運用,不太會實現(xiàn),要多練

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

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

  • 在iOS中隨處都可以看到絢麗的動畫效果,實現(xiàn)這些動畫的過程并不復(fù)雜,今天將帶大家一窺ios動畫全貌。在這里你可以看...
    每天刷兩次牙閱讀 8,573評論 6 30
  • 在iOS中隨處都可以看到絢麗的動畫效果,實現(xiàn)這些動畫的過程并不復(fù)雜,今天將帶大家一窺iOS動畫全貌。在這里你可以看...
    F麥子閱讀 5,145評論 5 13
  • A今天學了什么 1.animation 動畫 2.使用動畫animation B我掌握好的地方 1.animat...
    執(zhí)念念不直閱讀 201評論 0 0
  • 選擇qi:是表達式 標簽選擇器 類選擇器 屬性選擇器 繼承屬性: color,font,text-align,li...
    love2013閱讀 2,339評論 0 11
  • 天上月亮落淚 地上的人兒微醉 說是隔著遙遠的距離 說是無聲的思念掩藏 遠方的人兒在心里 在我甜甜的夢鄉(xiāng) 月亮,將我倆捆綁
    伶子風閱讀 187評論 0 0