Created
June 1, 2020 12:36
-
-
Save TomoG29/6be14fe9e70bfec903e2eb1029d8e0d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="box"> | |
<p id="res" class="res">まだクリック無し!</p> | |
<div class="btn-square"> | |
<p id="btn">ボタン</p> | |
</div> | |
</div> | |
<script>// <![CDATA[ | |
var Value = 0; | |
document.getElementById("btn").onclick = function() { | |
var str = Value + '回目のクリック'; | |
document.getElementById("res").innerHTML = str; | |
Value++; | |
}; | |
// ]]></script> | |
<style><!-- | |
.btn-square { | |
display: inline-block; | |
padding: 0.5em 1em; | |
text-decoration: none; | |
background: #668ad8;/*ボタン色*/ | |
color: #FFF; | |
border-bottom: solid 4px #627295; | |
border-radius: 3px; | |
} | |
.btn-square:active { | |
/*ボタンを押したとき*/ | |
-webkit-transform: translateY(4px); | |
transform: translateY(4px);/*下に動く*/ | |
border-bottom: none;/*線を消す*/ | |
} | |
.res { | |
color: #000000; | |
} | |
.box { | |
display: inline-block; | |
padding: 0.5em 1em; | |
text-decoration: none; | |
color: #67c5ff; | |
border: double 4px #67c5ff; | |
border-radius: 3px; | |
transition: .4s; | |
} | |
--></style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment