There are three different methods I've used to make floating shelves. All three methods are explained step by step here as well as the tools and fixings you'll need for the process.
The easiest method is if you have an alcove to fit them into, but they can be made to float in the middle of a normal wall fairly easily too.
If you have an alcove, this is an easy way to make a shelf that appears to be floating.
First, fix a batten across the back wall at the height you want the shelf, use a spirit level to make sure it's right. I use 35mm square planed timber.
After that fix two battens either side as well. Cut another one to go across the front and two noggins (one may be enough if it's a narrow alcove) to add strength and glue/screw them all on. To fix the noggins I drill pilot holes at an angle and fix with 50mm screws.
Then cut and pin some thin plywood onto the top and bottom of the frame to create the floating shelf. Finally, to top it off fix a cover strip across the front to hand the edges of the ply and batten and it's ready for paint/stain.
This is a really cheap way of making floating shelves, especially if you have a leftover off-cut of a door.Step 1: Assess the wall
First thing to do is work out what the wall is constructed from and decide how to fix to it. If the wall is masonry some brown plugs and 80/100mm screws will do. If it's a stud wall you want to locate where the studs are first so you can position your shelf where you can get a good fixing. Do this with a stud-finder or hammer and nail (bang a nail in at the height where it will be hidden by the shelf later). Once you know where the studs are you can decide on the length of the shelf, span it equally across the studs if you can. If you absolutely need to fix the shelf and there isn't a stud to fix one end into then use the strongest plasterboard fixings you can buy.
Step 2: Cut the shelf (door) to size
Rip the door to the width you want. For floating shelves like this I'd stay under 200mm deep. Clamp a straight edge to get a perfect cut with a circular saw. If you dont have clamps, screw a straight piece of timber to the part you are going to cut off. Remember to allow for the thickness of the blade. Cut the door to length after that too. I use a mitre saw, but again you can clamp a straight edge on and use a circular saw. Use a sharp chisel to remove the honeycomb cardboard and glue 50mm from the inside edges.step 3: Plane a fillet piece
Now the door will have two edges that are open and need timber in. Take some chunky timber like 50x50mm pse or similar and reduce it to fit inside the door. Do this with a table saw, thicknesser or electric planer.
Step 4: Cut and fix
Cut the timber so it will fit first in the end of the shelf, and glue that piece in. Then cut the last piece for the back edge that will be fixed to the wall. Fix the long one to the wall with screws and I put a decent helping of gripfill on the back edge as well for extra strength.
Step 5: fit the shelf
Glue the wall batten up with plenty of wood glue all the way round and slide the new shelf onto it. Pin it in place with a finish nailgun or 20mm panel pins(a nailgun is better than hammering which may loosen the batten from the wall.
This isn't essential but for a neater finish to floating shelves I mitre a flat piece of thin finished timber all the way around the front and sides that i've planed to the thickness of the shelf. This is a neat little finishing touch that ensures a nice tidy finish when the shelf is painted and also ensures no unsightly end grain is visible.
If you don't want to go to the trouble of making a floating shelf there are lots of ready to go floating shelves and/or special brackets available to buy that just need fixing to the wall. On this page you can see how I fix brackets to the walls if need be.