It seems like the styling is affecting all instances of text on my page.
Actually, it's not cascading everywhere. It's just being inherited from parent elements. The cascade in CSS refers to how rules are applied to matching elements, not how values are copied down from parents.
Is there a way to prevent this style from being inherited?
To stop inheritance, you need to explicitly set a different value for the property on the specific element where you don't want it to inherit. One way to do this is by targeting all child elements of the body and setting a different text alignment:
body > * {
text-align: left;
}
However, a better solution would be to avoid placing inline content directly in the body. Instead, wrap the content in a container element (like a div) and center the content within that container.