Newborn babies can get STDs like HIV if the mother has it when she's pregnant, giving birth, or breastfeeding. The virus can pass from mother to baby during these times.