Both colds and the flu are caused by viruses. Colds can be caused by a variety of viruses, whereas the flu is only caused by the influenza virus.