Creating crisp graphics in Photoshop requires pixel-perfect precision. It has the ability to operate at the sub pixel level when drawing shapes. However, this can lead to antialiasing problems and fuzzy looking graphics!
Anti-aliasing is used in the digital image domain as a way of smoothing curved shapes and edges that aren't perfectly vertical or horizontal. In the olden days (70s and 80s) resolution wasn't what is is today. There was a time when a pixel was either on or off or black and white. This made for very jagged-looking graphics on early computers.
As color resolution progressed and pixels gained the ability to become transparent (50% on or any other value) anti-aliasing solved the problem of jagged edges by adding higher color gradient steps or semi-transparent pixels to the image that went some way towards filling in the holes of the jagged edge, giving the illusion that the edge was now smooth.
In Photoshop anti-aliasing is a double-edged sword. Sure we have nice smooth lines but because Photoshop can operate at the sub-pixel level (anywhere inside a pixel) this can lead to some unwanted artifacts when drawing shapes.
Here's what I mean: I'm zoomed in at 1600% to a Photoshop document. You can see the pixels as a grid. If I grab my Rectangle shape tool and draw you can see I can start and finish the shape anywhere inside a pixel.
When I release you can see that Photoshop is trying to interpolate those sub-pixel values as shades of white (or grey). The less I select inside a pixel the darker it gets.
When I come to stoke a shape that is anti-aliased the result is even more confused as it tries to compensate for the anti-aliasing.
This can lead to your graphics appearing blurred and when making graphics for the web it's all about crisp lines. The best way to prevent this is to snap your drawing tools to a grid. This will ensure your tool selects 100% of the pixel every time and eliminate any unwanted anti-aliasing!
Go to Preferences > Grids, Guides and Slices.
In the Grid box make sure you're set to Pixels. I've set my value to 100px with a Subdivision of 1.
This will give me a grid of 100px in my document. Press Command - '˜ to show you the grid in your document.
You can also set up a your subdivisions to give you a more refined grid.
A 100px grid with 10 subdivisions gives me a grid line every 10px.
To enable snapping to press Shift-Command + '˜ You'll now find that your shape tools will snap to the grid giving you sharp lines every time.
This works very well for Rounded Rectangle and Circles, too. Your Layer Styles should retain crispy lines and smooth edges for a very professional look! You'll also find that any guides you drag out will also snap to the grid, which is handy! It also helps when creating shapes of consistent sizes.