亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

CSSボタン

CSSボタン

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<style>
.button {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
}
</style>
</head>
<body>
<h2>CSS 按鈕</h2>
<button>默認(rèn)按鈕</button>
<a href="#" class="button">鏈接按鈕</a>
<button class="button">按鈕</button>
<input type="button" class="button" value="輸入框按鈕">
</body>
</html>

ボタンの色

background-colorプロパティを使用してボタンの色を設(shè)定できます:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<style>
.button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
}
.button2 {background-color: #008CBA;} /* Blue */
.button3 {background-color: #f44336;} /* Red */ 
.button4 {background-color: #e7e7e7; color: black;} /* Gray */ 
.button5 {background-color: #555555;} /* Black */
</style>
</head>
<body>
<h2>按鈕顏色</h2>
<p>我們可以使用 background-color 屬性來設(shè)置按鈕顏色:</p>
<button class="button">Green</button>
<button class="button button2">Blue</button>
<button class="button button3">Red</button>
<button class="button button4">Gray</button>
<button class="button button5">Black</button>
</body>
</html>

ボタンサイズ

font-sizeプロパティを使用して次のことができます。ボタンのサイズを設(shè)定します:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style>
.button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
}
.button1 {font-size: 10px;}
.button2 {font-size: 12px;}
.button3 {font-size: 16px;}
.button4 {font-size: 20px;}
.button5 {font-size: 24px;}
</style>
</head>
<body>
</html>

丸いボタン

border-radius屬性を使用して丸いボタンを設(shè)定できます:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">  
<style>
.button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
}
.button1 {border-radius: 2px;}
.button2 {border-radius: 4px;}
.button3 {border-radius: 8px;}
.button4 {border-radius: 12px;}
.button5 {border-radius: 50%;}
</style>
</head>
<body>
<h2>圓角按鈕</h2>
<p>我們可以使用 border-radius 屬性來設(shè)置圓角按鈕:</p>
<button class="button button1">2px</button>
<button class="button button2">4px</button>
<button class="button button3">8px</button>
<button class="button button4">12px</button>
<button class="button button5">50%</button>
</body>
</html>

ボタンの境界線の色

border屬性を使用して設(shè)定できますボタンの境界線の色:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<style>
.button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
}
.button1 {
    background-color: white; 
    color: black; 
    border: 2px solid #4CAF50;
}
.button2 {
    background-color: white; 
    color: black; 
    border: 2px solid #008CBA;
}
.button3 {
    background-color: white; 
    color: black; 
    border: 2px solid #f44336;
}
.button4 {
    background-color: white;
    color: black;
    border: 2px solid #e7e7e7;
}
.button5 {
    background-color: white;
    color: black;
    border: 2px solid #555555;
}
</style>
</head>
<body>
<h2>按鈕邊框顏色</h2>
<p>我們可以使用 border 屬性設(shè)置按鈕邊框顏色:</p>
<button class="button button1">Green</button>
<button class="button button2">Blue</button>
<button class="button button3">Red</button>
<button class="button button4">Gray</button>
<button class="button button5">Black</button>
</body>
</html>

マウスオーバー ボタン

:hover セレクターを使用して、マウスオーバー ボタンのスタイルを変更できます。

ヒント: 「ホバー」効果の速度を設(shè)定するには、transition-duration 屬性を使用できます:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<style>
.button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 16px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    -webkit-transition-duration: 0.4s; /* Safari */
    transition-duration: 0.4s;
    cursor: pointer;
}
.button1 {
    background-color: white; 
    color: black; 
    border: 2px solid #4CAF50;
}
.button1:hover {
    background-color: #4CAF50;
    color: white;
}
.button2 {
    background-color: white; 
    color: black; 
    border: 2px solid #008CBA;
}
.button2:hover {
    background-color: #008CBA;
    color: white;
}
.button3 {
    background-color: white; 
    color: black; 
    border: 2px solid #f44336;
}
.button3:hover {
    background-color: #f44336;
    color: white;
}
.button4 {
    background-color: white;
    color: black;
    border: 2px solid #e7e7e7;
}
.button4:hover {background-color: #e7e7e7;}
.button5 {
    background-color: white;
    color: black;
    border: 2px solid #555555;
}
.button5:hover {
    background-color: #555555;
    color: white;
}
</style>
</head>
<body>
<h2>鼠標(biāo)懸停按鈕</h2>
<p>我們可以使用 :hover 選擇器來修改鼠標(biāo)懸停在按鈕上的樣式。</p>
<p><strong>提示:</strong> 我們可以使用 <code>transition-duration</code> 屬性來設(shè)置 "hover" 效果的速度:</p>
<button class="button button1">Green</button>
<button class="button button2">Blue</button>
<button class="button button3">Red</button>
<button class="button button4">Gray</button>
<button class="button button5">Black</button>
</body>
</html>

ボタンの影

box-shadow 屬性を使用してボタンに影を追加できます:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">  
<style>
.button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    -webkit-transition-duration: 0.4s; /* Safari */
    transition-duration: 0.4s;
}
.button1 {
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
.button2:hover {
    box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);
}
</style>
</head>
<body>
<h2>按鈕陰影</h2>
<p>我們可以使用 box-shadow 屬性來為按鈕添加陰影:</p>
<button class="button button1">陰影按鈕</button>
<button class="button button2">鼠標(biāo)懸停后出現(xiàn)陰影</button>
</body>
</html>

無効なボタン

opacity 屬性を使用してボタンに透明度を追加できます ( 「無効」屬性効果のように見えます)。

ヒント: カーソル屬性を追加し、それを「許可しない」に設(shè)定して、無効な畫像を設(shè)定できます:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<style>
.button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
}
.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
</style>
</head>
<body>
<h2>禁用按鈕</h2>
<p>我們可以使用 opacity 屬性為按鈕添加透明度 (看起來類似 "disabled" 屬性效果)。</p>
<button class="button">正常按鈕</button>
<button class="button disabled">禁用按鈕</button>
</body>
</html>

ボタンの幅

デフォルトでは、ボタンのサイズはボタン上のテキスト內(nèi)容によって決まります(テキストコンテンツの一致長に応じて)。 width 屬性を使用してボタンの幅を設(shè)定できます:

ヒント: 固定幅を設(shè)定したい場合は単位としてピクセル (px) を使用でき、応答性の高いボタンを設(shè)定したい場合は次のように設(shè)定できます。パーセンテージとして設(shè)定します。

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<style>
.button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
}
.button1 {width: 250px;}
.button2 {width: 50%;}
.button3 {
    padding-left: 0;
    padding-right: 0;
    width: 100%;
}
</style>
</head>
<body>
<h2>按鈕寬度</h2>
<p>默認(rèn)情況下,按鈕的大小有按鈕上的文本內(nèi)容決定( 根據(jù)文本內(nèi)容匹配長度 )。 我們可以使用 width 屬性來設(shè)置按鈕的寬度:</p>
<p><strong>提示:</strong>  如果要設(shè)置固定寬度可以使用像素 (px) 為單位,如果要設(shè)置響應(yīng)式的按鈕可以設(shè)置為百分比。</p>
<button class="button button1">250px</button><br>
<button class="button button2">50%</button><br>
<button class="button button3">100%</button>
</body>
</html>

ボタングループ

マージンを削除し、float:leftを追加してボタングループを設(shè)定します:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">  
<style>
.button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    cursor: pointer;
    float: left;
}
.button:hover {
    background-color: #3e8e41;
}
</style>
</head>
<body>
<h2>按鈕組</h2>
<p>移除外邊距并添加 float:left 來設(shè)置按鈕組:</p>
<button class="button">Button</button>
<button class="button">Button</button>
<button class="button">Button</button>
<button class="button">Button</button>
<p style="clear:both"><br>記住要清除浮動(dòng),否則下一個(gè) p 元素的按鈕也會(huì)顯示在同一行。</p>
</body>
</html>

ボーダー付きのボタングループ

ボーダー屬性を使用してボーダー付きのボタングループを設(shè)定できます:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<style>
.button {
    background-color: #4CAF50; /* Green */
    border: 1px solid green;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    cursor: pointer;
    float: left;
}
.button:hover {
    background-color: #3e8e41;
}
</style>
</head>
<body>
<h2>帶邊框按鈕組</h2>
<p>Add borders to create a bordered button group:</p>
<button class="button">Button</button>
<button class="button">Button</button>
<button class="button">Button</button>
<button class="button">Button</button>
<p style="clear:both"><br>記住要清除浮動(dòng),否則下一個(gè) p 元素的按鈕也會(huì)顯示在同一行。</p>
</body>
</html>

ボタンアニメーション

矢印を追加しますボタンの上にマウスを移動(dòng)した後にマークを付けます:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<style>
.button {
  display: inline-block;
  border-radius: 4px;
  background-color: #f4511e;
  border: none;
  color: #FFFFFF;
  text-align: center;
  font-size: 28px;
  padding: 20px;
  width: 200px;
  transition: all 0.5s;
  cursor: pointer;
  margin: 5px;
}
.button span {
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: 0.5s;
}
.button span:after {
  content: '?';
  position: absolute;
  opacity: 0;
  top: 0;
  right: -20px;
  transition: 0.5s;
}
.button:hover span {
  padding-right: 25px;
}
.button:hover span:after {
  opacity: 1;
  right: 0;
}
</style>
</head>
<body>
<h2>按鈕動(dòng)畫</h2>
<button class="button" style="vertical-align:middle"><span>Hover </span></button>
</body>
</html>

クリック時(shí)に「波紋」効果を追加:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<style>
.button {
    position: relative;
    background-color: #4CAF50;
    border: none;
    font-size: 28px;
    color: #FFFFFF;
    padding: 20px;
    width: 200px;
    text-align: center;
    -webkit-transition-duration: 0.4s; /* Safari */
    transition-duration: 0.4s;
    text-decoration: none;
    overflow: hidden;
    cursor: pointer;
}
.button:after {
    content: "";
    background: #90EE90;
    display: block;
    position: absolute;
    padding-top: 300%;
    padding-left: 350%;
    margin-left: -20px!important;
    margin-top: -120%;
    opacity: 0;
    transition: all 0.8s
}
.button:active:after {
    padding: 0;
    margin: 0;
    opacity: 1;
    transition: 0s
}
</style>
</head>
<body>
<h2>按鈕動(dòng)畫 - 波紋效果</h2>
<button class="button">Click Me</button>
</body>
</html>

クリック時(shí)に「押し下げ」効果を追加:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">  
<style>
.button {
  display: inline-block;
  padding: 15px 25px;
  font-size: 24px;
  cursor: pointer;
  text-align: center;   
  text-decoration: none;
  outline: none;
  color: #fff;
  background-color: #4CAF50;
  border: none;
  border-radius: 15px;
  box-shadow: 0 9px #999;
}
.button:hover {background-color: #3e8e41}
.button:active {
  background-color: #3e8e41;
  box-shadow: 0 5px #666;
  transform: translateY(4px);
}
</style>
</head>
<body>
<h2>按鈕動(dòng)畫 - "按壓效果"</h2>
<button class="button">Click Me</button>
</body>
</html>


學(xué)び続ける
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style> .button { background-color: #4CAF50; /* Green */ border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; cursor: pointer; float: left; } .button:hover { background-color: #3e8e41; } </style> </head> <body> <h2>按鈕組</h2> <p>移除外邊距并添加 float:left 來設(shè)置按鈕組:</p> <button class="button">Button</button> <button class="button">Button</button> <button class="button">Button</button> <button class="button">Button</button> <p style="clear:both"><br>記住要清除浮動(dòng),否則下一個(gè) p 元素的按鈕也會(huì)顯示在同一行。</p> </body> </html>
提出するリセットコード