Quick Tip: Don’t Always Jump Back to Photoshop
Tutorial Details
- Topic: CSS3 Inset Shadows
- Difficulty: Basix
- Format: 7 Minute Screencast
- Button: Get it on GraphicRiver
In today’s video quick tip, we’ll use the lesser known inset parameter when creating CSS3 box shadows to properly style the hover and active states of a button.
Remember: don’t always be so quick to jump back to Photoshop when you need a few small changes. It’s better for you (and the web) if you first ask yourself, “Can we accomplish this with simple CSS?”
Final Source
body {
margin: 200px auto;
}
a {
background: url(button.png) no-repeat;
width: 130px; height: 130px;
margin: auto;
outline: none;
display: block;
text-indent: -10000px;
-webkit-box-shadow: 0 0 8px 1px rgba(0,0,0,.2);
-webkit-border-radius: 90px;
-moz-box-shadow: 0 0 8px 1px rgba(0,0,0,.2);
-moz-border-radius: 90px;
box-shadow: 0 0 8px 1px rgba(0,0,0,.2);
border-radius: 90px;
}
a:hover {
-webkit-box-shadow:
0 0 8px 1px rgba(0,0,0,.2),
inset 0 0 20px 6px rgba(0,0,0,.1);
-moz-box-shadow:
0 0 8px 1px rgba(0,0,0,.2),
inset 0 0 20px 6px rgba(0,0,0,.1);
box-shadow:
0 0 8px 1px rgba(0,0,0,.2),
inset 0 0 20px 6px rgba(0,0,0,.1);
}
a:active {
-webkit-box-shadow:
0 0 8px 1px rgba(0,0,0,.2),
inset 0 0 20px 6px rgba(0,0,0,.2);
-moz-box-shadow:
0 0 8px 1px rgba(0,0,0,.2),
inset 0 0 20px 6px rgba(0,0,0,.2);
box-shadow:
0 0 8px 1px rgba(0,0,0,.2),
inset 0 0 20px 6px rgba(0,0,0,.2);
}
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
- http://pehbehbeh.de/ pehbehbeh
- http://daniel-rauber.de Daniel
- http://www.damnsemicolon.com Skye
- http://www.johnejohnson.org John Johnson
- http://www.monsterwpthemes.com/ JD
- http://www.portal-media.net schiwe
- Damion
- http://www.dazydude.net Rik de Vos
- SalmanAbbas007
- SalmanAbbas007
- Damion
- bhavin
- http://www.salmanfolio.com salmanlp
- http://www.keyboard-computer.com/ Stefan
- navy92f
- Ciwan
- jeremy
- http://www.vanderwijk.com Johan
- http://jazdesign.co.uk Jaz
- Brad
- http://www.gamer36 Gamer36
- toxiN
- Mark
- http://GoTweed.com.au markaid
- Thall
- MEBS
- Elliott
- kankuro
- http://www.nouveller.com/ Benjamin Reid
- arnold
- http://www.sitebase.be Sitebase
- Pawel
- http://www.buzzednow.com Harvz
- http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-dont-always-jump-back-to-photoshop/ papa
- http://www.templatebase.info/ templatebase
- http://www.webinthehub.com WITH
- Waseem
- http://www.fraserbathrooms.co.uk Wetrooms Edinburgh
- http://vivekipedia.tumblr.com Vivek Shrinivasan
- gareth
