CSS selector for element within element with inline style?

A bit late to the tea party but thought I would share the solution I found & use.

@simone’s answer is perfect if you can match the style attribute exactly. However, if you need to target an inline style attribute that may have other inline styles associated with it you can use:

p[style*="text-align:center;"]

“*=” means “match the following value anywhere in the attribute
value.”

For further reference or more detailed information on other selectors see this blog post on css-tricks.com:

The Skinny On CSS Selectors

The Skinny on CSS Attribute Selectors

Leave a Comment