How was Venice built?

Venice was built on water but how could they live with water underneath their house? would it flood?
its your job to find out...