CSSでボタンクリックに押された効果を追加する
次のコードを実行して、ボタンのクリックで押された効果を追加することができます
例
<!DOCTYPE html>
<html>
<head>
<style>
.button {
background-color: orange;
color: white;
border: none;
border-radius: 7px;
box-shadow: 0 5px #999;
display: inline-block;
padding: 10px;
font-size: 16px;
cursor: pointer;
text-align: center;
outline: none;
}
.button:hover {
background-color: blue;
}
.button:active {
background-color: orange;
box-shadow: 0 5px gray;
transform: translateY(2px);
}
</style>
</head>
<body>
<button class = "button">Result</button>
</body>
</html> -
CSSを使用して、ボタンに透明度を追加します
ボタンに透明度を追加するには、CSSの不透明度プロパティを使用します。これにより、ボタンの外観が無効になります。 次のコードを実行して、ボタンに透明度を追加してみてください 例 <!DOCTYPE html> <html> <head> <style> .btn1 { color: black; &n
-
CSSを使用して画像にボタンを追加するにはどうすればよいですか?
以下は、CSSを使用して画像にボタンを追加するためのコードです- 例 <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> img{ width: 100%; } div { position: relative; width: 100%; &nb