我需要获取标签的偏移位置...我
HtmlElementCollection sp = textwebBrowser1.Document.GetElementsByTagName("span");
用来获取跨度标签的集合....但在某些情况下,即使我在页面中有跨度标签,集合的计数为零...我猜这是因为一些带有图像信息的对象标签...例如-
在这种情况下,我不知道如何检索 span 标签的偏移量
HTML 代码:
<HTML><BODY>.....Using <OBJECT> and <EMBED><HTML><HEAD><TITLE>A Web page with a rolling die</TITLE></HEAD><BODY><OBJECT ID="Dieroll1"CLASSID="CLSID:46646B43-EA16-11CF-870C-00201801DDD6"CODEBASE="dieroll.cab#Version=1,0,0,1"WIDTH="200"HEIGHT="200"><PARAM NAME="ForeColor" VALUE="0"><PARAM NAME="BackColor" VALUE="16777215"><PARAM NAME="Image" VALUE="beans.bmp"><EMBED LIVECONNECT NAME="Dieroll1"WIDTH="200"HEIGHT="200"CLASSID="CLSID:46646B43-EA16-11CF-870C-00201801DDD6"TYPE="application/oleobject"CODEBASE="dieroll.cab#Version=1,0,0,1"PARAM_ForeColor="0"PARAM_BackColor="16777215"></OBJECT><BR>Hthe die</BODY></HTML>Arrange to run Explorer when you debug the control.Here's the syntax for an OBJECT tag that sets the Image property:<OBJECTCLASSID="clsid:46646B43-EA16-11CF-870C-00201801DDD6"CODEBASE="http://www.gregcons.com/test/dieroll.ocx"ID=die1WIDTH=200HEIGHT=200ALIGN=centerHSPACE=0VSPACE=0><PARAM NAME="Dots" VALUE="1"><PARAM NAME="Image" VALUE="http://www.gregcons.com/test/beans.bmp">and the <span style='background-color: rgb(255, 255, 0);'>image</span> file you are using....</BODY></HTML>