This sounds like it is caused by a soil borne fungus. The condition is known as "Damping Off" . The best way to prevent damping off is to use sterile soil. You can buy a sterile soil mix at your local garden center. To insure that it is sterile or to sterilize soil of unknown condition you can cook it either in the oven or microwave. As long as all parts of the soil reach 180 degrees Fahrenheit you can be assured that the damping off fungus has been killed. Try not to exceed 200 degrees F. as toxins may be developed in the soil. If seeds damp off when sown in the sterile soil they could be harboring the fungus on the seed coat. Then a dip in a mixture of 3 parts water to 2 parts bleach for 10 minutes followed by a clean water rinse should kill the fungus on the seed surface.