Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Button Basics (jacojoubert.ca)
95 points by heycarsten on July 5, 2011 | hide | past | favorite | 23 comments


No body is mentioning but the tutorial is really descriptive in content where much of the design tutorials on the web lacks. It explains each design step, not 'how to do it' but 'why to do it', which i think developer minds looking for in design.

I will have an eye on this, keep up the good work.


So to get this straight, the author created a button image in photoshop, then created the same style using css3, took a picture of both, zoomed in, and compared the pixelated blockyness? ... While completely disregarding the fact that actually zooming in on the css3 version in the browser would avoid any pixelation and blockyness in the first place?


He's zooming in so you can see the pixels. He obviously isn't talking about putting giant, stretched-out buttons on an actual site.


Which is not what I'm talking about either. I'm just saying it's a bit ironic to need to zoom in on a button to even distinguish any quality differences and then giving the quality award to the method that isn't suitable for scaling.


The zoomed image was meant to illustrate why the photoshop button was rendered better at default size - it has nothing to do with browser zooming.


I understand that, in fact I mentioned that the aspect of zooming was completely ignored in my first post, and I found it ironic that it was.

But anyway, lets forget about that fact for now. If you need to zoom in 400-800x on some pixels to even be able to spot the differences, then in practical terms there are no differences. You can't expect your typical visitor to sit in front of the monitor with a magnifying glass sweating at your pixel perfect buttons. Honestly, no one is going to give it much more than a glance, so attention to detail you can hardly spot with the naked eye is almost completely pointless.

Now to come back to my main point: what isn't pointless is maintaining quality when zooming in with the browser. This is something I often do myself when I'm too lazy to put my contacts in to just casually browse the web. Just about every website looks like a mess of blurry/pixelated crap when you do that. Had he just went with the css3 approach, the quality at non standard zoom levels would far outweigh the minuscule pixel details at normal zoom levels between the css3 and photoshop versions.

Anyway, that's all I really wanted to say. Had the point been that CSS3 styling was still iffy with older browsers being around and the photoshop button was superior for that reason, I wouldn't have said anything. But to dismiss it based on some differences in pixelation you wouldn't even spot normally, while ignoring that if you had actually zoomed in the browser there would be no pixelation at all with the "inferior" css3 version, was just too much.


The problem with image buttons like the ones shown are that they visually break when zoomed in (tested in Chrome). When I zoom in, the right side of the buttons does no longer fit perfectly with the rest of the button: it get moved by some 2 pixels up, while the rest of the button remains in place.

I've experienced this problem on many websites, that's why I try to avoid composite image buttons whenever possible. Either I create a button of only one image(which often can't be reused) or I create if with CSS3 (some compatibility issues).


The problem with image buttons like the ones shown are that they visually break when zoomed in

Breaking features that paying users overwhelmingly do not use is not a showstopper for most businesses. I don't actively hate power-users, but if you're savvy enough to do anything other than open up the browser in the default settings and make with the clicky-clicky, you're savvy enough to undo it when you run into problems.

See also: "I disabled Javascript and your website broke", "I disable first-party cookies by default and your website broke", "I couldn't get your website to work on my wife's computer which I set up to run Lynx on Ubuntu Dapper" (no, really), etc.

I feel a lot worse over the related answer for disabled users, since they typically don't have an option to turn off being disabled, but the economics are the same: 100% higher development costs to improve the experience of under 1% of users is not feasible.


I'm one of the people perennially angry over 'I disabled JavaScript and your website broke,' but that's limited to sites that should work fine with JS off. Like this guy's - it's a blog post. A blog post should not completely break with JS off.

What I think isn't that 'the site breaks with JS off' is inherently terrible. Some sites actually do require JS - but that's far fewer than the number that think that they require JS, and completely breaking with JS off is a very distinct code smell. It says 'this person does not sweat the details.'


RE: disability, the economics are a little different, insofar as if you're a big enough target [1] it can be considered discrimination in a bunch of places.

Also, angry geeks aren't your decision-making customers/normal users, so you're not [as likely to be] foregoing revenue with them as you are with disabled users.

I don't mean this to come off as a holier-than-thou accessibility rant, but just thought the two situations were different enough to note.

1. http://www.law.com/jsp/cc/PubArticleCC.jsp?id=1159347929235 (pun possibly intended)


That economic argument against paying to help the disabled access services is the reason why the ADA was passed.

It's a tough decision where to draw the line. A purely economic decision seems soulless; accommodation of everyone will bankrupt you.


> The problem with image buttons like the ones shown are that they visually break when zoomed in (tested in Chrome). When I zoom in, the right side of the buttons does no longer fit perfectly with the rest of the button: it get moved by some 2 pixels up, while the rest of the button remains in place.

Using Camino (FF3 or FF3.5 engine, something like that) there isn't even a need to zoom in: the alignment is broken by default[0], and when zooming in the button sometimes "tears" out[1]

[0] http://imgur.com/5yHZ5

[1] http://imgur.com/fCVhW


Is this still the case? If so I will get it fixed. I didn't do any testing yet because the blog post was not meant to go live yet.


> Is this still the case?

It is.


Oh man, Camino uses Gecko 1.9.0 which is the same version Firefox 3.0 shipped with (but the buttons work in firefox 3.0).

I traced down the bug to a conflict in my blog's css with the buttons. Somewhere they are inheriting styles that break them. The code for the buttons on github does not have this problem.

I would love to fix this, but Camino doesn't appear to have any sort of developer tool. How are you suppose to debug things?


Zooming as it is is a broken mechanic. Google Docs already attempts to detect if you are zooming in and tells you to zoom to 100% or things will be broken. I wish there was a reliable way to detect if the user is at a weird zoom level.


Not only that, but they also break when not using a mouse. Or when white backgrounds annoy you and you reverse colours. Or in any number of other cases.

Stupid idea, but sadly popular.


Fyi, using Dropbox as a replacement for real image hosting (either on your own server or through a service such as S3) means that anyone at work who can't get to a Dropbox URL can't see basically anything worthwhile on your site.


Author here: I will move the images over to a real host as soon as I can. The blog post was incomplete and only published so some friends could read it over. Wasn't meant to go live at all.


Sorry about that :-(


Great tutorial if you want to create buttons form scratch in photoshop with and use css sprites.

What I would like to see, is a simple javascript api on top to generate all the nitty gritty css in the browser. That's excatly what sproutcore and sencha touch does.


One downside with image buttons: they are really, really, annoying to localize. A compromise would be to have the button itself as an image and overlay the label in HTML.


That is how this is done. The label is html, only the background is an image.




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

Search: