title: Retrieve the offset of <span> tag in web browser control C#
body: <p>I need to get the offset position of  tag...
  I am using 
  <code>HtmlElementCollection sp = textwebBrowser1.Document.GetElementsByTagName("span");</code>
  to get a collection of span tags....but in some cases even if i have span tags in the page,the count of the collection is zero...I guess it is because of some object tags with image information in between...example-</p>
  
  <p>I don't know how to retrieve the offset of span tag in this case</p>
  
  <p>HTML CODE:</p>
  
  <pre><code>&lt;HTML&gt;&lt;BODY&gt;.....Using &lt;OBJECT&gt; and &lt;EMBED&gt;&lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;A Web page with a rolling die&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;OBJECT ID="Dieroll1"CLASSID="CLSID:46646B43-EA16-11CF-870C-00201801DDD6"CODEBASE="diero‌​ll.cab#Version=1,0,0,1"WIDTH="200"HEIGHT="200"&gt;&lt;PARAM NAME="ForeColor" VALUE="0"&gt;&lt;PARAM NAME="BackColor" VALUE="16777215"&gt;&lt;PARAM NAME="Image" VALUE="beans.bmp"&gt;&lt;EMBED LIVECONNECT NAME="Dieroll1"WIDTH="200"HEIGHT="200"CLASSID="CLSID:46646B43-EA16-11CF-870C-002‌​01801DDD6"TYPE="application/oleobject"CODEBASE="dieroll.cab#Version=1,0,0,1"PARAM‌​_ForeColor="0"PARAM_BackColor="16777215"&gt;&lt;/OBJECT&gt;&lt;BR&gt;Hthe die&lt;/BODY&gt;&lt;/HTML&gt;Arrange to run Explorer when you debug the control.Here's the syntax for an OBJECT tag that sets the Image property:&lt;OBJECTCLASSID="clsid:46646B43-EA16-11CF-870C-00201801DDD6"CODEBASE="http://www.gregcons.com/test/dieroll.ocx"ID=die1WIDTH=200HEIGHT=200ALIGN=centerHSPACE=0VSPACE=0&gt;&lt;PARAM NAME="Dots" VALUE="1"&gt;&lt;PARAM NAME="Image" VALUE="http://www.gregcons.com/test/beans.bmp"&gt;and the &lt;span style='background-color: rgb(255, 255, 0);'&gt;image&lt;/span&gt; file you are using....&lt;/BODY&gt;&lt;/HTML&gt;
  </code></pre>