CSSを使用してボタンをアニメーション化する方法は?
以下は、CSSでボタンをアニメーション化するためのコードです-
例
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
button {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
position: relative;
background-color: rgb(100, 0, 84);
border: none;
font-size: 28px;
color: rgb(255, 169, 255);
padding: 20px;
width: 200px;
text-align: center;
-webkit-transition-duration: 0.4s;
box-shadow: 5px 10px 18px rgb(121, 82, 185);
transition-duration: 0.4s;
text-decoration: none;
overflow: hidden;
cursor: pointer;
}
button:after {
content: "";
background: rgb(251, 255, 0);
display: block;
position: absolute;
padding-top: 300%;
padding-left: 350%;
margin-left: -20px;
margin-top: -120%;
opacity: 0;
transition: all 0.8s
}
button:active:after {
padding: 0;
margin: 0;
opacity: 1;
transition: 0s
}
</style>
</head>
<body>
<h1>Animated Button Example</h1>
<button>Click Here</button>
<h1>Click on the above button to see ripple effect</h1>
</body>
</html> 出力
上記のコードは次の出力を生成します-
-
CSSで検索ボタンを作成するにはどうすればよいですか?
以下は、CSSで検索ボタンを作成するためのコードです- 例 <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.c
-
CSSを使用してリスト内の弾丸をアニメーション化する方法
順序付けられていないリストで箇条書きのスタイルを設定するには、リストスタイルのporを使用できます 構文 CSSli-styleプロパティの構文は次のとおりです- li { list-style: /*value*/ } 例 次の例は、CSSのliスタイルのプロパティを示しています。 <!DOCTYPE html> <html> <head> <style> li {