After some searching, I came to the conclusion that it is not possible to extract CSS styles using the PHP DOM parser . Can anyone confirm this?
An element may, for example, indicate its ID . If this element has a style attribute (element style="abc" ), this attribute value can also be obtained. But if the style of an element is determined by an ID from a CSS selector , PHP does not seem to have direct access to the styles.
The only workaround I see is to parse all the related CSS files and check for the styles assigned to this ID . Is it correct?
source share