To target an h1 in your class called “poetry”, its .markdown-preview-view.poetry h1 . But that’s just in the Reading view. To also change things in Live Preview:
.markdown-preview-view.poetry h1,
.markdown-source-view.is-live-preview .cm-header-1 {
color: green;
}
The CSS selectors and changes for each view won’t be identical though. How to find and work with Obsidian’s CSS stuff.