"3D Buttons Effects (fix, with button release on mouse leaving)"
Bootstrap 3.3.0 Snippet by eschmid72

<div class="container"> <div class="row"> <h2>CSS3 3D Button Effects</h2> Text <!-- Standard button --> <button type="button" class="btn3d btn btn-default btn-lg"><span class="glyphicon glyphicon-download-alt"></span> Default</button> <button type="button" class="btn3d btn btn-white btn-lg"><span class="glyphicon glyphicon-tag"></span> White</button> <!-- Provides extra visual weight and identifies the primary action in a set of buttons --> <button type="button" class="btn btn-primary btn-lg btn3d"><span class="glyphicon glyphicon-cloud"></span> Primary</button> <!-- Indicates a successful or positive action --> <button type="button" class="btn btn-success btn-lg btn3d"><span class="glyphicon glyphicon-ok"></span> Success</button> <!-- Contextual button for informational alert messages --> <button type="button" class="btn btn-info btn-lg btn3d"><span class="glyphicon glyphicon-question-sign"></span> Info</button> <!-- Indicates caution should be taken with this action --> <button type="button" class="btn btn-warning btn-lg btn3d"><span class="glyphicon glyphicon-warning-sign"></span> Warning</button> <!-- Indicates a dangerous or potentially negative action --> <button type="button" class="btn btn-danger btn-lg btn3d"><span class="glyphicon glyphicon-remove"></span> Danger</button> <button type="button" class="btn btn-magick btn-lg btn3d"><span class="glyphicon glyphicon-gift"></span> Magick</button> <!-- Deemphasize a button by making it look like a link while maintaining button behavior --> <a href="http://www.jquery2dotnet.com/" class="btn btn-link btn-lg btn3d" role="button"><span class="glyphicon glyphicon-globe"></span> Link</a> <p> Text <button type="button" class="btn btn-primary btn-lg btn3d"><span class="glyphicon glyphicon-thumbs-up"></span></button> <button type="button" class="btn btn-danger btn-lg btn3d"><span class="glyphicon glyphicon-off"></span></button> </p> <p> Text <button type="button" class="btn btn-primary btn-lg btn3d">Large button</button> <button type="button" class="btn btn-default btn-lg btn3d">Large button</button> </p> <p> Text <button type="button" class="btn btn-primary btn3d">Default button</button> <button type="button" class="btn btn-default btn3d">Default button</button> </p> <p> Text <button type="button" class="btn btn-primary btn-sm btn3d">Small button</button> <button type="button" class="btn btn-default btn-sm btn3d">Small button</button> </p> <p> Text <button type="button" class="btn btn-primary btn-xs btn3d">Extra small button</button> <button type="button" class="btn btn-default btn-xs btn3d">Extra small button</button> </p> </div> </div>
.btn3d { border: 0; margin-bottom: 10px; margin-left: 2px; margin-right: 2px; margin-top: 10px; position: relative; top: -6px; transition: all 40ms linear; background-image: none; } .btn3d:active:hover { top: 2px; } .btn3d:active:focus { -moz-outline-style: none; outline: medium none; } .btn3d:focus { -moz-outline-style: none; outline: medium none; } .btn3d:focus:hover { -moz-outline-style: none; outline: medium none; } .btn3d.active:hover { top: 2px; } .btn3d.btn-white { background-color: #ffffff; box-shadow: 0 0 0 1px #ebebeb inset, 0 0 0 2px rgba(255, 255, 255, 0.1) inset, 0 8px 0 0 #f5f5f5, 0 8px 8px 1px rgba(0, 0, 0, 0.2); color: #666666; } .btn3d.btn-white:active, .btn3d.btn-white .active { background-color: #ffffff; color: #666666; } .btn3d.btn-white:active:hover, .btn3d.btn-white .active:hover { box-shadow: 0 0 0 1px #ebebeb inset, 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 1px 3px 1px rgba(0, 0, 0, 0.1); } .btn3d.btn-default { background-color: #f9f9f9; box-shadow: 0 0 0 1px #ebebeb inset, 0 0 0 2px rgba(255, 255, 255, 0.1) inset, 0 8px 0 0 #bebebe, 0 8px 8px 1px rgba(0, 0, 0, 0.2); color: #666666; } .btn3d.btn-default:active, .btn3d.btn-default.active { background-color: #f9f9f9; color: #666666; } .btn3d.btn-default:active:hover, .btn3d.btn-default.active:hover { box-shadow: 0 0 0 1px #ebebeb inset, 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 1px 3px 1px rgba(0, 0, 0, 0.1); } .btn3d.btn-primary { background-color: #4274d7; box-shadow: 0 0 0 1px #417fbd inset, 0 0 0 2px rgba(255, 255, 255, 0.15) inset, 0 8px 0 0 #4d5bbe, 0 8px 8px 1px rgba(0, 0, 0, 0.5); } .btn3d.btn-primary:active, .btn3d.btn-primary.active { background-color: #4274d7; } .btn3d.btn-primary:active:hover, .btn3d.btn-primary.active:hover { box-shadow: 0 0 0 1px #417fbd inset, 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 1px 3px 1px rgba(0, 0, 0, 0.3); } .btn3d.btn-success { background-color: #78d739; box-shadow: 0 0 0 1px #30cd00 inset, 0 0 0 2px rgba(255, 255, 255, 0.15) inset, 0 8px 0 0 #5eb924, 0 8px 8px 1px rgba(0, 0, 0, 0.5); } .btn3d.btn-success:active, .btn3d.btn-success.active { background-color: #78d739; } .btn3d.btn-success:active:hover, .btn3d.btn-success.active:hover { box-shadow: 0 0 0 1px #30cd00 inset, 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 1px 3px 1px rgba(0, 0, 0, 0.3); } .btn3d.btn-info { background-color: #39b3d7; box-shadow: 0 0 0 1px #00a5c3 inset, 0 0 0 2px rgba(255, 255, 255, 0.15) inset, 0 8px 0 0 #348fd2, 0 8px 8px 1px rgba(0, 0, 0, 0.5); } .btn3d.btn-info:active, .btn3d.btn-info.active { background-color: #39b3d7; } .btn3d.btn-info:active:hover, .btn3d.btn-info.active:hover { box-shadow: 0 0 0 1px #00a5c3 inset, 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 1px 3px 1px rgba(0, 0, 0, 0.3); } .btn3d.btn-warning { background-color: #feaf20; box-shadow: 0 0 0 1px #d79a47 inset, 0 0 0 2px rgba(255, 255, 255, 0.15) inset, 0 8px 0 0 #d79a34, 0 8px 8px 1px rgba(0, 0, 0, 0.5); } .btn3d.btn-warning:active, .btn3d.btn-warning.active { background-color: #feaf20; } .btn3d.btn-warning:active:hover, .btn3d.btn-warning.active:hover { box-shadow: 0 0 0 1px #d79a47 inset, 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 1px 3px 1px rgba(0, 0, 0, 0.3); } .btn3d.btn-danger { background-color: #d73814; box-shadow: 0 0 0 1px #b93802 inset, 0 0 0 2px rgba(255, 255, 255, 0.15) inset, 0 8px 0 0 #aa0000, 0 8px 8px 1px rgba(0, 0, 0, 0.5); } .btn3d.btn-danger:active, .btn3d.btn-danger.active { background-color: #d73814; } .btn3d.btn-danger:active:hover, .btn3d.btn-danger.active:hover { box-shadow: 0 0 0 1px #b93802 inset, 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 1px 3px 1px rgba(0, 0, 0, 0.3); } .btn3d.btn-magick { background-color: #bb39d7; box-shadow: 0 0 0 1px #9a00cd inset, 0 0 0 2px rgba(255, 255, 255, 0.15) inset, 0 8px 0 0 #9823d5, 0 8px 8px 1px rgba(0, 0, 0, 0.5); color: #ffffff; } .btn3d.btn-magick:active, .btn3d.btn-magick.active { background-color: #bb39d7; } .btn3d.btn-magick:active:hover, .btn3d.btn-magick.active:hover { box-shadow: 0 0 0 1px #9a00cd inset, 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 1px 3px 1px rgba(0, 0, 0, 0.3); }

Similar snippets: See More


Comments:

comments powered by Disqus