According to the United States Flag Code, the flag should not touch whatever is beneath it, be it grass, water, floor, table or ground. This is a rule of respect and is not necessarily an enforceable rule.
The United States Flag Code is a set of rules and regulations detailing proper display, storage, lighting, handling and respect for the American flag. As of April 2008, the Flag Code's eighth section covers proper respect for the flag, which includes the rule that "The flag should never touch anything beneath it, such as the ground, the floor, water or merchandise." The Flag Code also states that when covering caskets, the flag's edges should not touch the ground. This set of rules is a comprehensive guide to proper treatment for the Flag of the United States of America.