here at nadesign.net/safari ;) the orange one, and even in the flickr's stylesheet. Maybe we can make a project like uniform (http://pixelmatrixdesign.com/uniform/), but using CSS only ;)
Rendering graphics with CSS has many advantages: less bandwidth and http petitions, easier maintainability and scalability, plus that you don't need a graphic software to create and edit them. I made this all from the same CSS selector, and tweaked all the states from it. Imagine the power of that.
For example, imagine you suddenly decide you want bigger buttons on your website. Instead of redoing all the graphic stuff, slice it and set the CSS to make it work, all you need to do is change font size, or padding, or the color of the gradient… It's really useful :)
Na, we definitely should put more stuff in $Experiments ;)
@Alberto Wow, that's amazing. I think it's very interesting to see how the browser is capable of rendering these shapes and styles nowadays. :)
Oh, I just noticed. The 2nd button, it's supposed to show the hover state of the button right? I think maybe you could use a darker shade or color to make it clearer? From what I see now the hover state is very subtle (noticeable but not clear enough). But then again, I could be wrong. I suppose when you use it as a real button the effect is much stronger than seen in the preview.
Thank you all. I really appreciate your support and comments! :D
Just added the code for you to check it. @Thomas(s) go check it out.
The inset shadows are made with the inset value on box-shadow. As easy as that. Works fine on Safari5+, Chrome, Firefox and Opera. Safari 4 neither support multiple box shadows.
@Andy, you're totally right. It's very subtle, but the effect in the real button is perfectly noticeable ;)
While this is pretty neat, calling it cross-browser is somewhat misguiding... It surely degrades on older browsers, but they immediately stop being gorgeous... I guess I'll stick to images for the meantime :)
Well, if you use an awesome browser you get an awesome result… and if you use a shitty one at least you have a decent result. If we developers and designers don't push, this will never get better ;)
I am currently working on a whole custom GUI that just uses CSS (only icons are graphics). I think it’s not a big deal to make nice buttons for old browsers,too. Only for the highlight you need a 1px (transparent white) graphic. The gradient is possible in IE, too (via some IE filter I think).
I will try to build this example in the browser sometime later today:
@Alberto Yeah I see we disagree here. Rounded corners, CSS3 selectors, some nice CSS transitions – all fine, all stuff I really love to use.
But custom buttons are too much part of the overall design for me to leave them unstyled for older browsers. For me it’s a challenge and really fun to find a nice and elegant solution (one that only server properitary code in a properitary way of course – so conditional comments and IE filters are fine for me).
But like I said – we don’t agree here and I don’t really think we need to discuss : )
Yeah, I see your point, and I understand that for some clients the degradation could be too much, specially when IE is still (and sadly) the most used browser in the world. It's completely fine for me ;)
A tip to make this awesome button even better would be to move the text down by 1 pixel on the :active state to give an even more realistic depressed state. 1 pixel goes a long way!
Well, depending of the lightning and the shape of the button in all states. This one doesn't need that, but yeah, it's a nice effect. A bit overused IMO, but definitely nice :)
Si Alberto, lamentablemente. Lo que pasa es que quería usar inset shadows con las imágenes y rounded corners pero se ve terrible. Vi esto en mi mac y lo probé en windows a ver si era cross platform pero ya veo que no.
PS. Deberías hacerte un pack de esos botones y venderlos en CodeCanyon :)
39 responses
Just made some nice buttons with CSS3. Lovely, huh?
[Edit]: Just added the code for you to check it.
2 months ago
Cool!
2 months ago
love it! would love to see the code someday :P
2 months ago
Thanks, guys!
@Jonatan, it's pretty easy to do with CSS3. You should try, seriously ;)
2 months ago
awesome! I love them :D
2 months ago
nice, did you see mine CSS button?
2 months ago
@Na, nope. Where is it, dude?
2 months ago
Looks nice! I know this sounds stupid but does it make any difference in loading time if CSS button is used instead of image button on a website?
2 months ago
here at nadesign.net/safari ;) the orange one, and even in the flickr's stylesheet. Maybe we can make a project like uniform (http://pixelmatrixdesign.com/uniform/), but using CSS only ;)
2 months ago
Thanks, Andy!
Rendering graphics with CSS has many advantages: less bandwidth and http petitions, easier maintainability and scalability, plus that you don't need a graphic software to create and edit them. I made this all from the same CSS selector, and tweaked all the states from it. Imagine the power of that.
For example, imagine you suddenly decide you want bigger buttons on your website. Instead of redoing all the graphic stuff, slice it and set the CSS to make it work, all you need to do is change font size, or padding, or the color of the gradient… It's really useful :)
Na, we definitely should put more stuff in $Experiments ;)
2 months ago
You rocks!!
2 months ago
Hahaha, thanks, buddy! :)
2 months ago
Lovely!
2 months ago
I think you should release the code, this might be a scam :p
2 months ago
How did you what inset shadow? (third button)
2 months ago
@Alberto Wow, that's amazing. I think it's very interesting to see how the browser is capable of rendering these shapes and styles nowadays. :)
Oh, I just noticed. The 2nd button, it's supposed to show the hover state of the button right? I think maybe you could use a darker shade or color to make it clearer? From what I see now the hover state is very subtle (noticeable but not clear enough). But then again, I could be wrong. I suppose when you use it as a real button the effect is much stronger than seen in the preview.
2 months ago
Thank you all. I really appreciate your support and comments! :D
Just added the code for you to check it. @Thomas(s) go check it out.
The inset shadows are made with the inset value on box-shadow. As easy as that. Works fine on Safari5+, Chrome, Firefox and Opera. Safari 4 neither support multiple box shadows.
@Andy, you're totally right. It's very subtle, but the effect in the real button is perfectly noticeable ;)
2 months ago
While this is pretty neat, calling it cross-browser is somewhat misguiding... It surely degrades on older browsers, but they immediately stop being gorgeous... I guess I'll stick to images for the meantime :)
2 months ago
Well, if you use an awesome browser you get an awesome result… and if you use a shitty one at least you have a decent result. If we developers and designers don't push, this will never get better ;)
2 months ago
Great work Alberto :)
2 months ago
Great work!
I am currently working on a whole custom GUI that just uses CSS (only icons are graphics). I think it’s not a big deal to make nice buttons for old browsers,too. Only for the highlight you need a 1px (transparent white) graphic. The gradient is possible in IE, too (via some IE filter I think).
I will try to build this example in the browser sometime later today:
Example
And if you plan to start a project for this thing, you could call me in for making it nicer in older browsers : )
2 months ago
Thanks again, guys :)
@Reimar, the challenge was doing it without images and using web standards. That discards using non standard IE filters ;)
I think the time of hacks and overwork is over. Let's promote web standards and reward ppl that uses better browsers with better experience.
2 months ago
Very clever, and looks cool.
2 months ago
@Alberto Yeah I see we disagree here. Rounded corners, CSS3 selectors, some nice CSS transitions – all fine, all stuff I really love to use.
But custom buttons are too much part of the overall design for me to leave them unstyled for older browsers. For me it’s a challenge and really fun to find a nice and elegant solution (one that only server properitary code in a properitary way of course – so conditional comments and IE filters are fine for me).
But like I said – we don’t agree here and I don’t really think we need to discuss : )
Keep on with the great work.
2 months ago
Yeah, I see your point, and I understand that for some clients the degradation could be too much, specially when IE is still (and sadly) the most used browser in the world. It's completely fine for me ;)
2 months ago
A tip to make this awesome button even better would be to move the text down by 1 pixel on the :active state to give an even more realistic depressed state. 1 pixel goes a long way!
2 months ago
Well, depending of the lightning and the shape of the button in all states. This one doesn't need that, but yeah, it's a nice effect. A bit overused IMO, but definitely nice :)
2 months ago
Really nice work, I like the active state too.
2 months ago
Looks awesome. I tend to stick to images to maintain the same look across all browsers but the quality of the HTML output has made me stop and think.
Nice work!
2 months ago
Thanks, guys!
@James, glad you find it useful and somewhat challenging :)
2 months ago
Dude, that's some dead sexy CSS. Awesome job!
about 1 month ago
Thanks!! :)
about 1 month ago
The inset shadow looks terrible in Chrome :(
about 1 month ago
Windows? Sigh
about 1 month ago
Si Alberto, lamentablemente. Lo que pasa es que quería usar inset shadows con las imágenes y rounded corners pero se ve terrible. Vi esto en mi mac y lo probé en windows a ver si era cross platform pero ya veo que no.
PS. Deberías hacerte un pack de esos botones y venderlos en CodeCanyon :)
Saludos.
about 1 month ago
Too bad. I hope they fix it soon :(
Thanks!
about 1 month ago
It looks killer!
However, Webkit and Gecko have some serious problems when rendering these sort of things over a dark background.
I'm working on a fix for it (basically, stop using CSS borders, and fake them using shadows) and will dribbble it when it's ready : )
about 1 month ago
Nice. That's another option, yeah. The possibilities of box-shadow are infinite. Can't wait to see what you come up with ;)
about 1 month ago
Rebound
CSS3 Buttons
July 29, 2010
Some fixes for when you want to use CSS3 buttons on dark / image backgrounds.
The code: http://gist.github.com/498736
about 1 month ago