{"id":31373,"date":"2016-01-13T17:53:18","date_gmt":"2016-01-13T12:23:18","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=31373"},"modified":"2016-12-19T15:37:04","modified_gmt":"2016-12-19T10:07:04","slug":"how-to-create-button-in-3d-effect-with-the-help-of-css3","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/how-to-create-button-in-3d-effect-with-the-help-of-css3\/","title":{"rendered":"HOW TO CREATE BUTTON IN 3D EFFECT WITH THE HELP OF CSS3"},"content":{"rendered":"<p>How we can use CSS Transition to make it look like a button is 3D when you press it. For this we use the box-shadow property which starts off with a high value and when the we press the button for change the box-shadow value to be lower making it look like the button is being push down.<\/p>\n<p>To achieve this look we are use the <a href=\"http:\/\/www.w3.org\/TR\/CSS2\/selector.html#dynamic-pseudo-classes\">CSS active selector<\/a> which becomes active when the visitor click on the attached element.<\/p>\n<p>We can change effect according us.<\/p>\n<p><strong>{HTML}<\/strong><br \/>\n<code><br \/>\n&lt;p&gt;Click to activate.&lt;\/p&gt;<br \/>\n&lt;p&gt;&amp;nbsp&lt;\/p&gt;<br \/>\n&lt;p&gt;<br \/>\n&lt;button class=\"bt-facebook\"&gt;&lt;\/button&gt;<br \/>\n&lt;button class=\"bt-twitter\"&gt;&lt;\/button&gt;<br \/>\n&lt;button class=\"bt-in\"&gt;&lt;\/button&gt;<br \/>\n&lt;button class=\"bt-vimeo\"&gt;&lt;\/button&gt;<br \/>\n&lt;\/p&gt;<br \/>\n  <\/code><\/p>\n<p><strong>{CSS}<\/strong><\/p>\n<p><code><br \/>\n@font-face {<br \/>\nfont-family: 'socialfont';<br \/>\nsrc: url('http:\/\/mediaashley.com\/MyFont.ttf') format('truetype');<br \/>\nfont-weight: normal;<br \/>\nfont-style: normal;<br \/>\n&nbsp;<br \/>\n}<br \/>\n<\/code><br \/>\n&nbsp;<br \/>\n<code>body<br \/>\nbackground: #ddd;<br \/>\nwidth: 100%;<br \/>\nmargin: 72px;<br \/>\n} <\/code><br \/>\n<code><br \/>\nbutton {x<br \/>\nwidth:102px;<br \/>\nheight:102px;<br \/>\ndisplay:inline-block;<br \/>\nfont-family: Helvetica;<br \/>\nfont-size: 15px;<br \/>\nfont-weight: bold;<br \/>\ncolor:#fff;<br \/>\ntext-decoration: none;<br \/>\ntext-transform: uppercase;<br \/>\ntext-align: center;<br \/>\ntext-shadow:2px 2px 0px #000fff;<br \/>\npadding-top:7px;<br \/>\nmargin-left: auto;<br \/>\nmargin-right: auto;<br \/>\nleft:30px;<br \/>\nposition:relative;<br \/>\ncursor:pointer;<br \/>\nborder: none;<br \/>\nbackground: #444ddd;<br \/>\nbackground-image: linear-gradient(bottom, rgb(14,137,182) 0%, rgb(22,179,236) 100%);<br \/>\nborder-radius: 6px;<br \/>\nbox-shadow: inset 0px 2px 0px #8389e1, 0px 6px 0px 0px #000fff, 0px 10px 5px #999;<br \/>\n} <\/code><br \/>\n<code>button:active {<br \/>\ntop:3px;<br \/>\nbox-shadow: inset 0px 1px 0px #000fff, 0px 2px 0px 0px #000fff, 0px 5px 3px #000fff;<br \/>\n}<\/code><br \/>\n<code>button:before {<br \/>\nfont-family: 'socialfont';<br \/>\nfont-size: 52px;<br \/>\nline-height: 1em;<br \/>\nfont-weight: normal;<br \/>\ncolor: #fff;<br \/>\ncontent:\"\\F020\";<br \/>\nwidth:86px;<br \/>\nheight:92px;<br \/>\ndisplay:block;<br \/>\nposition:absolute;<br \/>\npadding-top:11px;<br \/>\ntop:10px;<br \/>\ntext-shadow: 1px 1px 3px #000fff;<br \/>\n&nbsp;<br \/>\n}<\/code><br \/>\n&nbsp;<br \/>\n<code>button:active:before {<br \/>\ntop: 8px;<br \/>\nfont-size: 52px;<br \/>\ntext-shadow: 0px 4px 0px #000fff, 0px 6px 1px #000fff\/*, 3px 0px 1px #000fff, 3px 3px 1px #000fff, -2px 0px 1px #68cff2*\/;<br \/>\n}<\/code><br \/>\n&nbsp;<br \/>\n<code>.bt-twitter:before {<br \/>\ncontent:\"\\F021\";<br \/>\n}<\/code><br \/>\n<code>.bt-in:before {<br \/>\ncontent:\"\\F022\";<br \/>\n}<\/code><br \/>\n<code>.bt-vimeo:before{<br \/>\ncontent:\"\\F024\";<br \/>\n}<\/code><\/p>\n<p><code><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-31374\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/01\/3dEffectbuttonimg.jpg\" alt=\"3dEffectbuttonimg\" width=\"518\" height=\"233\" \/><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How we can use CSS Transition to make it look like a button is 3D when you press it. For this we use the box-shadow property which starts off with a high value and when the we press the button for change the box-shadow value to be lower making it look like the button is [&hellip;]<\/p>\n","protected":false},"author":773,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":11},"categories":[1],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/31373"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/773"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=31373"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/31373\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=31373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=31373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=31373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}