How do I style post content?
I'm currently setting
<div dangerouslySetInnerHTML={{ __html: props.pageContext.content }}/>
to dump my conent onto a page. However I'd like to add classes and style the specific pieces of content.
I couldn't find anything in the guidelines.
Hey @kostimarko!
Right now we don't have builtin methods for manipulating html content/strings (to add classnames). You can style your content using something like:
<div className="someClassName" dangerouslySetInnerHTML={{ __html: props.pageContext.content }}/>
and target elements with appropiate selectors - i.e.:
.someClassName p {
}
etc
Thanks!
Most helpful comment
Hey @kostimarko!
Right now we don't have builtin methods for manipulating html content/strings (to add classnames). You can style your content using something like:
<div className="someClassName" dangerouslySetInnerHTML={{ __html: props.pageContext.content }}/>and target elements with appropiate selectors - i.e.:
etc