Dark Button Navigation Using CSS3
I recently came across a great looking set of navigational buttons designed by Orman Clark of Premium Pixels. I’m a big fan of his design style and decided to whip together a quick CSS3/HTML version of the buttons. Check out the demo and feel free to download the example zip file as well.
The CSS:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | /* Dark Button CSS */ .button { outline: 0; padding: 5px 12px; display: block; color: #9fa8b0; font-weight: bold; text-shadow: 1px 1px #1f272b; border: 1px solid #1c252b; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; background: #232B30; /* old browsers */ background: -moz-linear-gradient(top, #3D4850 3%, #313d45 4%, #232B30 100%); /* firefox */ background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#3D4850), color-stop(4%,#313d45), color-stop(100%,#232B30)); /* webkit */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3D4850', endColorstr='#232B30',GradientType=0 ); /* ie */ box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* CSS3 */ -moz-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Firefox */ -webkit-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Safari, Chrome */ } .button:hover { color: #fff; background: #4C5A64; /* old browsers */ background: -moz-linear-gradient(top, #4C5A64 3%, #404F5A 4%, #2E3940 100%); /* firefox */ background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#4C5A64), color-stop(4%,#404F5A), color-stop(100%,#2E3940)); /* webkit */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C5A64', endColorstr='#2E3940',GradientType=0 ); /* ie */ } .button:active { background-position: 0 top; position: relative; top: 1px; color: #fff; padding: 6px 12px 4px; background: #20282D; /* old browsers */ background: -moz-linear-gradient(top, #20282D 3%, #252E34 51%, #222A30 100%); /* firefox */ background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#20282D), color-stop(51%,#252E34), color-stop(100%,#222A30)); /* webkit */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#20282D', endColorstr='#222A30',GradientType=0 ); /* ie */ -moz-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Firefox */ -webkit-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Safari, Chrome */ box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* CSS3 */ } /* Search CSS: */ .search-input { padding: 0 5px 0 22px; border: 1px solid #1c252b; height: 30px; color: #9fa8b0; font-size: 12px; line-height: 30px; font-weight: bold; text-shadow: 1px 1px #1f272b; border-radius: 25px; -moz-border-radius: 25px; -webkit-border-radius: 25px; background: #20282D; /* old browsers */ background: -moz-linear-gradient(top, #20282D 3%, #252E34 51%, #222A30 100%); /* firefox */ background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#20282D), color-stop(51%,#252E34), color-stop(100%,#222A30)); /* webkit */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#20282D', endColorstr='#222A30',GradientType=0 ); /* ie */ -moz-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Firefox */ -webkit-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Safari, Chrome */ box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* CSS3 */ } .search-input:focus {outline: none;} .search-submit { width: 13px; height: 13px; border: none; background: url(mag-glass.png) no-repeat; display: block; position: absolute; left: 26px; top: 10px; text-indent: -9999em; } /* Vertical List: */ .vertical-list { list-style: none; padding: 10px; width: 200px; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; background: #20282D; /* old browsers */ background: -moz-linear-gradient(top, #20282D 3%, #252E34 51%, #222A30 100%); /* firefox */ background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#20282D), color-stop(51%,#252E34), color-stop(100%,#222A30)); /* webkit */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#20282D', endColorstr='#222A30',GradientType=0 ); /* ie */ -moz-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Firefox */ -webkit-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Safari, Chrome */ box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* CSS3 */ } .vertical-list .button { border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; background: #515B62; /* old browsers */ background: -moz-linear-gradient(top, #515B62 3%, #444E55 5%, #394147 100%); /* firefox */ background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#515B62), color-stop(5%,#444E55), color-stop(100%,#394147)); /* webkit */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#515B62', endColorstr='#394147',GradientType=0 ); /* ie */ } .vertical-list .button:hover { background: #5F6B72; /* old browsers */ background: -moz-linear-gradient(top, #5F6B72 3%, #56646C 4%, #4D5A62 50%, #434D54 100%); /* firefox */ background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#5F6B72), color-stop(4%,#56646C), color-stop(50%,#4D5A62), color-stop(100%,#434D54)); /* webkit */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5F6B72', endColorstr='#434D54',GradientType=0 ); /* ie */ } .vertical-list .button:active { padding: 5px 12px; top: 0; background: #515B62; /* old browsers */ background: -moz-linear-gradient(top, #515B62 3%, #444E55 5%, #394147 100%); /* firefox */ background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#515B62), color-stop(5%,#444E55), color-stop(100%,#394147)); /* webkit */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#515B62', endColorstr='#394147',GradientType=0 ); /* ie */ -moz-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Firefox */ -moz-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Firefox */ -webkit-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Safari, Chrome */ box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* CSS3 */ } |
The HTML:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <ul class="button-list"> <li><a href='/' class='button'>Home</a></li> <li><a href='/' class='button'>About</a></li> <li><a href='/' class='button'>Portfolio</a></li> <li><a href='/' class='button'>Blog</a></li> <li class="search"><input type="text" class="search-input" name="search" value="Search" onclick="$(this).val('');" /><input type="submit" class="search-submit" /></li> </ul> <h3>Vertical Menu:</h3> <ul class="vertical-list"> <li><a href='/' class='button'>Home</a></li> <li><a href='/' class='button'>Our Studio</a></li> <li><a href='/' class='button'>Portfolio</a></li> <li><a href='/' class='button'>Our Team</a></li> <li><a href='/' class='button'>Get in Touch</a></li> </ul> |
About the Demo
The only image used in the demo is for the textured background – all other gradients and effects are done with CSS3. As a result, compatibility is limited to a handful of browsers, including Firefox, Chrome, Safari and possibly IE8. It looks strange in IE7 and the gradients don’t work in Opera, so I’d use caution if you’re considering using these in a production environment.
It’s quite easy to reproduce this effect using images, which is why I decided to go for the slightly more challenging route of using CSS3. If you’re really good, you’ll want to have an image-based solution as a backup for browsers that don’t support fancy CSS3 effects yet. I’ll leave that up to you guys though. ;)
As always, feedback and constructive criticism is always welcome. Be sure to check out Orman’s blog, it’s chock full of great resources!
Enjoyed the post?
Then you should follow me on Twitter or subscribe to the RSS feed.



Pingback: Tweets that mention Dark Button Navigation Using CSS3 | DevGrow -- Topsy.com
Pingback: Dark Button Navigation Using CSS3
Pingback: 15 Super Cool CSS3 Navigation Menus And Tutorials | Bloggermint
Pingback: CSS3 Button Solutions – Easy To Use
Pingback: Diseño Web: 10 colecciones de botones CSS3 listos para usar | CreativaSfera - Sandra Guerrero Sanmartí
Pingback: Dark Button Navigation Using CSS3 | Null Script
Pingback: 20个很酷的使用CSS3制作的导航菜单教程 | 百锐网
Pingback: 20个很酷的使用CSS3制作的导航菜单教程 | WEB2.0社区
Pingback: 20 HTML5 And CSS3 Tips,Tutorials, Demo & Download : DesignMock
Pingback: 30 Excellent CSS3 Tutorials | Lake of Web
Pingback: 20个很酷的CSS3导航菜单制作教程 - 炫意 HTML5
Pingback: 20个很酷的CSS3导航菜单制作教程 – 峰随意动,尽从容!
Pingback: 44 Excellent CSS3 Tutorials | 1 step web design
Pingback: 25 Best CSS3 Navigation and Button Tutorials : DesignMock- Complete Design Sence
Pingback: 20 a cool CSS3 navigation menu making tutorial
Pingback: 20 个很酷的使用 CSS3 制作的导航菜单教程
Pingback: 010 Css3 Menu | Free Css3 Menus | Horizontal Css3 Menus
Pingback: HTML5 and CSS3 Tutorials : The set of great HTML5 and CSS3 Tuts for your Theming Career - TechnoGrate - TechnoGrate
Pingback: 40+ Excellent CSS3 Menu Tutorials | CS5 Design
Pingback: Pinboard Links | Reverse The Web
Pingback: 20 个很酷的使用 CSS3 制作的导航菜单教程 | 莲娜用户体验研究日志 Lyna UED
Pingback: Valuable CSS3 Tutorials for the Creative Designers | codeManiac - Snippets, Templates, API and the best developer content
Pingback: 50 CSS3 Navigation & Menus Tutorials
Pingback: Ecommerce CSS3 website menu builder « Headstartcms
Pingback: Free CSS3 Menu and Navigation Tutorials by Web Factory South Africa
Pingback: CSS3 Menu and Navigation [Free Tutorials] | Plus Web Design
Pingback: 20 best CSS3 navigation menu selection of designs tutorial Web Page Design | Web Page Design Templates | Html5 Template
Pingback: 40+ Excellent CSS3 Menu Tutorials 2012
Pingback: 20个新颖的CSS3导航菜单分享制作教程 - 中文吧
Pingback: 30 Effective CSS3 Tutorials - PelFusion
Pingback: 30 Effective CSS3 Tutorials | Html5 Tutorials
Pingback: 30 Effective CSS3 Tutorials
Pingback: 20 个很酷的使用 CSS3 制作的导航菜单教程 | 站长站
Pingback: Captain-HTML – Dark Button Navigation Using CSS3
Pingback: Free CSS3 Menu and Navigation Tutorials - DesignModo Dev
Pingback: Excellent CSS3 Menu Tutorials : HueDesigner
Pingback: 5 Colecciones de Botones CSS3 | Cuestión de Código - Tús Códigos Hechos Fáciles
Pingback: 15+ CSS3 Menu and Navigation Tutorials - CSSReflex
Pingback: 15+ CSS3 Menu and Navigation Tutorials // Balochtech.com
Pingback: Dark Button Menu Navigation Using Only CSS3 - Boxy App
Pingback: 20个很酷的CSS3导航菜单制作教程 | 田淏予博客
Pingback: Excellent CSS3 Menu Tutorials | Creative Verse
Pingback: 35 Top Free CSS3 Navigation Menus of 2013