We have a strip of cardboard under the front of some of our taller shelves. Just the thick cardboard from a cardboard box. Just get a box from the supermarket and chop it up. We dont have any skirting boards at all, but the carpet bumps up a bit where the skirting board would be, so we cant put the shelves completely flush with the walls. The cardboard helps make not such a noticeable gap behind the shelf.
Our shelves are stuck to the wall using a thick peice a fabric nailed to the back of the shelf and the wall. Its worked so far, but she isnt much of a shelf climber.
Bookmarks