A section of DNA that codes for a trait or protein.