果展示
在這里插入圖片描述
?
Hello!小伙伴!
非常感謝您閱讀海轟的文章,倘若文中有錯誤的地方,歡迎您指出~
自我介紹 ?(?ˊ?ˋ)?
昵稱:海轟
標(biāo)簽:程序猿|C++選手|學(xué)生
簡介:因C語言結(jié)識編程,隨后轉(zhuǎn)入計算機專業(yè),有幸拿過一些國獎、省獎...已保研。目前正在學(xué)習(xí)C++/Linux/Python
學(xué)習(xí)經(jīng)驗:扎實基礎(chǔ) + 多做筆記 + 多敲代碼 + 多思考 + 學(xué)好英語!
在這里插入圖片描述
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>
<section><span></span></section>
</body>
</html>
CSS
html,body{
margin: 0;
height: 100%;
}
body{
display: flex;
justify-content: center;
align-items: center;
background: #263238;
}
section {
width: 650px;
height: 300px;
padding: 10px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
border: 2px solid red;
}
span {
width : 96px;
height: 96px;
border-radius: 50%;
display: inline-block;
position: relative;
border: 10px red;
border-style: dashed solid solid dotted;
border-bottom-color: transparent;
animation: rotation 2s linear infinite ;
}
span::after{
content: '';
position: absolute;
left: 51px;
top: 79px;
border: 20px solid transparent;
border-right-color: red;
transform: rotate(-45deg);
}
@keyframes rotation {
0% { transform: rotate(0deg) }
100% { transform: rotate(360deg)
}
}
使用span標(biāo)簽作為箭尾,設(shè)置為
width : 96px;
height: 96px;
border: 10px red;
border-style: dashed solid solid dotted;
border-bottom-color: transparent;
效果圖如下
在這里插入圖片描述
span標(biāo)簽圓角化
border-radius: 50%;
效果圖如下
在這里插入圖片描述
使用span::after偽類元素 作為箭頭
設(shè)置為
position: absolute;
border: 20px solid transparent;
border-right-color: red;
transform: rotate(-45deg);
效果圖如下
設(shè)置span::after的位置
注:
/*這里箭頭需要移動的距離*/
left: 51px;
top: 79px;
效果圖如下
為span添加動畫
animation: rotation 2s linear infinite ;
/*動畫實現(xiàn)*/
@keyframes rotation {
0% { transform: rotate(0deg) }
100% { transform: rotate(360deg)
}
}
效果圖如下
在這里插入圖片描述
文章僅作為學(xué)習(xí)筆記,記錄從0到1的一個過程。
希望對您有所幫助,如有錯誤歡迎小伙伴指正~
ello,大家好,今天講一個js的廣告圖片下落的js的demo
上效果圖,當(dāng)你打開一個網(wǎng)頁時會有廣告下落,那么我們怎么寫js呢?效果圖:
先寫html代碼:
再寫javascript代碼:
好了,今天的js分享結(jié)束了,記得關(guān)注暖夕H2
*請認真填寫需求信息,我們會在24小時內(nèi)與您取得聯(lián)系。