Hacker News new | past | comments | ask | show | jobs | submit login

CSS Buttons are all well and good for simple styles and rapid prototyping. But what happens when your boss asks you to add an icon inside the button? Or stretch it vertically? Or add it to an email bulletin?

And the time you claim to have gained by not having to fire up photoshop and knock out a few simple buttons, you'll lose again by having to test in different browsers. Also consider readability, maintainability, future-proofing your code, semantic html.

edit: and if the ability to autogenerate arbitrary buttons is important, knock up a server side script to create the graphics for you. Really. That's much nicer than doing it in CSS for all but the simplest of cases.




adding an icon inside a button is far simpler with css buttons, stretching it vertically is obviously miles miles easier with css than with images, email is just a whole other nightmare that I really dont think should even be considered when talking about sane html / css.

I dont understand how you can possibly think generating text inside images to be more readable or semantic, future proof or maintainable.

nor do I understand how you think things creating generating images programatically on the server is easier or nicer than coding up a a .btn class

the cross browser issues might have some possible point, but in reality most people are just going to be copying and pasting from someone else who has worried about these things (I regularly copy and paste the css from gmail buttons)


Good points, esp re email. I'm not particularly wedded to either side of the debate really, but:

> generating text inside images

oh, nonono, I was thinking more in terms of INPUT.button{background-image: url(btn.php?button_attributes_in_json);}

> adding an icon inside a button is far simpler with css buttons

depends what wonderful CSS you're using to create your button.

> generating images programatically on the server is easier

you say 'programmatically' like I'm suggesting something beyond taking a few pre-made slices and combining them into one image before serving it up. I'm not.


>you say 'programmatically' like I'm suggesting something beyond taking a few pre-made slices and combining them into one image before serving it up. I'm not.

heh its not "hard", but its already a hell of a less convenient than what I just do now with css.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: