Tag Archives: css

PHP: Select HTML elements with more than one css class using XPath

Recently, while working on my project FeedAPI ImageGrabber I came across the issue where I had to select HTML elements by a given css class. The HTML element can have a single CSS class:

<div class="foo"></div>

or multiple CSS classes associated with it.

<div class="foo exp tar"></div>

Now if you want to select the HTML elements with class “foo”, this div element would be one of them.
Continue reading