Yellow journalism contributed to the war with Spain by:
1. **Publishing sensational stories**: Yellow journalism involved the exaggerated and often sensationalized reporting of events. In the context of the war with Spain, yellow journalism outlets published sensational stories of Spanish atrocities. These stories were designed to provoke strong emotional responses from the public and inflame public opinion towards war.
This kind of reporting influenced public sentiment by painting Spain in a negative light and fostering a sense of outrage among American citizens. As a result, the public became more supportive of going to war with Spain based on the information presented in these sensationalized stories.
In summary, yellow journalism played a significant role in shaping public opinion and pushing the United States closer to war with Spain through its sensationalized and often misleading coverage of Spanish actions during that time.