It's best to use a book that will be larger than those you will be stacking on top. You could use an outdated Encyclopedia or perhaps a water-damaged art book you just can't bear to through away.
You will need two "L" bracket into the back of the book. They can be purchased at any home improvement store for around $5.00. Flip the book upside down. Make sure you strike a balance in placing the brackets depending on the size of your book. Place each bracket an inch to 2 inches fro the outside edges of the book.
Choose screws that are appropriately sized to your book. Secure the "L" brackets to the book with a drill. You can use washers if you prefer, but it's not necessary.
Secure the back of the book to the brackets with hot glue or double stick tape so that the book cover doesn't flop down.
Use wall anchors to secure the base book into the wall. You can buy them in packets, or kits, of multiple anchors for around $10.
To find the right placing for your shelf, hold your bracketed book up to the wall. With a level, make sure your brackets are even and trace drill holes on the wall with a pencil.
If you can, find wall anchors that have self-driving screws. These are easier than regular screws because you don't need a starter hole to get the screw to go in smoothly. Just drill the self-driving screw in one fluid motion.
Next, hold the "L" bracket up to the self-starting screws and secure with the screw provided.
Start stacking your books on your floating bookshelf! You should put no more than 5 or 6 books depending on their sizes and weights.