Is it possible to have a CSS rule that matches an element only if it contains a certain child?
Basically I have post content, where there could be inline images. I want all images to be centered but not the text. It looks like there is a patter to the inline images. They appear like this:
<p>Some text</p>
<p>
<!-- I want this p to be centered since it's an image -->
<a href="#"><img src="http://fpoimg.com/500x500"/></a>
</p>
<p>Some more text</p>
Is there any possible way without modifying the html to do this solely with some fancy CSS selectors? I know how to do it with jQuery, but I've always been interested if there are some new CSS selectors to help achieve this.