title: How to scrape a style attribute associated with a class from html
body: <p>I am using simple_html_dom scraping class for this.</p>
  
  <p>I have a html element with a class and I want to scrape the background-color attribute for this class. How do I achieve this?</p>
  
  <pre><code>&lt;div class="identifier"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I can pick up the div via:</p>
  
  <pre><code>$output = $html-&gt;find('.identifier');
  </code></pre>
  
  <p>But the style rules for the identifier class is in the style sheet.</p>