Building Railings    
  Much of a decks character will come from the style of handrail you select. Building codes usually require railings to be 36" tall, with openings no more than four to six inches.
Installing Rail Posts    
  To locate the posts, divide each side of the deck into equal segments of five to seven feet. Where the rail meets the house, you can bolt a 2x4 or 4x4 to the wall for extra stiffness. Usa a level to make sure that the posts are vertical on adjacent sides. It's hard to install the railing if the posts aren't in line. Resist the temptation to fully tighten the bolts until the post is plumb.

To bring the posts back vertical against the rim joist, insert cedar shims at the top or bottom of the post which ever is need to level the post, and tighten bolts.

Measuring a Stair Post    
  Marking the height of a stair railing on a post can be a tricky affair. You have to establish a line that projects along the stair nosing(the front edges of the treads). Use a long straight board to project a line down the steps. Then you can mark the rail height by measuring upward from the bottom of the board to any point on the uncut post. Remember to subtract the thickness of the railing.Transfer the stair angle to the post with a bevel gauge.
Calculating Horizontal Rail Spacing    
    To calculate the space between horizontal rails, add the widths of all the boards. (for example, the measurement for four 2x4's is 14 inches, as each board is actually 3" wide.) Then subtract this total from the 34 inch space between the top rail and the decking (34 - 14 = 20). Divide the remaining space by the number of spaces between the boards to get the spacing in inches (20 divided by 4 - 5.125, or 5 1/8 inches.)
Baluster Spacing    
  The secret to professional- looking railings is precise layout and installation. Make sure you install the first baluster vertical and in the center of each run. Then use a spacer block to install all the rest. This way, you do not have to check every baluster for location and plumb.

Don't try to make all the posts on each side of your deck the same distance apart. Usually it can't be done. Instead divide each run of posts evenly along the edge of the deck, and try to keep the baluster spacing about 5 - 6 inches within each section.

Marking a Railing Miter    
  An angled cut, or miter, ia a neat way to join two rails at a corner. For rails thar meet at right angles the cut should be 45 degrees. But don't assume that two 45 degree cuts will fit precisely. The posts or deck will probably be slightly out of whack. So its a good idea to mark your cuts in place. Lay one top rail on top of the other and use blocks of scrap to level the one on top. Mark the corners where they intersect. Use a stright-edge to connect the corners. Then cut the angles.

Let the boards run long at either end until the miter is tight. Then cut the other ends to length. This technique gives you a precious second chance.

Safe Handrails    
  Stairs are the scene of many accidents - more than one million each year in the U.S. alone. Handrails guard against such mishaps, and building codes are quite specific about defining a proper handrail. For example, the rail must be "graspable." That is, thumb and fingers must be able to curl around it. To prevent clothes from snagging, the rail must end at the posts at both the top and bottom of the stairs.

One of the easiest rails to grab is a dowel, 1 inches in diameter - often sold as closet pole - mounted on support brackets. For small children you might even install a seperate rail about two feet above the nosing line.