(借地方存个帖子)急:请教一个vml中文字摆放位置的问题
来源:互联网 发布:淘宝上怎么凑单 编辑:程序博客网 时间:2024/04/30 15:44
我需要在rect中放置文字,但下列代码中文字无法放置道rect中。
请大家帮我看看出错在哪。我试了下 该group中的coordsize为100,100 就可以实现了。但我其他已画好的图形都用到这个group,不可能更改它的coordsize,还有没有什么其他办法解决?
<html xmlns:v>
<STYLE>
v/:*{behavior:url(#default#VML);} //声明变量v为VML对象
</STYLE>
<body>
<v:Group id=grouphjm style="Z-INDEX:10;LEFT:0px;POSITION:relative;TOP:0px; WIDTH:400px;HEIGHT:400px;"
coordsize="100,-100" coordorigin="50 -50" >
<!--X轴-->
<v:Line style="Z-INDEX:3" from="-30,0" to="30,0" strokecolor="blue" strokeweight="1pt">
<v:stroke endarrow="classic" dashstyle="dashdot">
</v:stroke>
</v:Line>
<!--Y轴-->
<v:Line style="Z-INDEX:8" from="0,-20" to="0,20" strokecolor="blue" strokeweight="1pt">
<v:stroke endarrow="classic" dashstyle="dashdot">
</v:stroke>
</v:Line>
<v:roundrect style='left:-20;top:-20;width:18;height:10;' fillcolor="red">
<v:textbox>
<a href="http://www.msdn.com/"> Click here</a>
</v:textbox>
</v:roundrect>
</v:Group>
</body>
---------
加入insert参数,然后自己设置一下位置,搞定..... 程序修改如下:
<html xmlns:v>
<STYLE>
v/:*{behavior:url(#default#VML);} //声明变量v为VML对象
</STYLE>
<body>
<v:Group id=grouphjm style="Z-INDEX:10;LEFT:0px;POSITION:relative;TOP:0px; WIDTH:400px;HEIGHT:400px;"
coordsize="100,-100" coordorigin="50 -50" >
<!--X轴-->
<v:Line style="Z-INDEX:3" from="-30,0" to="30,0" strokecolor="blue" strokeweight="1pt">
<v:stroke endarrow="classic" dashstyle="dashdot">
</v:stroke>
</v:Line>
<!--Y轴-->
<v:Line style="Z-INDEX:8" from="0,-20" to="0,20" strokecolor="blue" strokeweight="1pt">
<v:stroke endarrow="classic" dashstyle="dashdot">
</v:stroke>
</v:Line>
<v:roundrect style='left:-20;top:-20;width:18;height:10;' fillcolor="red">
<v:textbox inset="0px,-40px,0px,0px">
<a href="http://www.msdn.com/"><font size=2>Click here</font></a>
</v:textbox>
</v:roundrect>
</v:Group>
</body>
----------------------------
不是很明白你的意思,是不是这样啊...... 直接保存为html打开来看效果
<script>
function AddFont(){
obj_TextRect=document.createElement("v:rect")
obj_TextRect.id="bguest"
obj_TextRect.style.left=10
obj_TextRect.style.top=10
obj_TextRect.style.height=10
obj_TextRect.style.width=20
obj_TextBox=document.createElement("v:textbox")
obj_TextBox.inset="10px,-30px,20px,0px"
obj_TextBox.innerText="test"
obj_TextRect.appendChild(obj_TextBox)
// alert(obj_TextBox.value)
document.all.grouphjm.appendChild(obj_TextRect)
}
</script>
<html xmlns:v>
<STYLE>
v/:*{behavior:url(#default#VML);} //声明变量v为VML对象
</STYLE>
<body>
<input type="button" value="AddFont" onclick="AddFont()">
<v:Group id=grouphjm style="Z-INDEX:10;LEFT:0px;POSITION:relative;TOP:0px; WIDTH:400px;HEIGHT:400px;"
coordsize="100,-100" coordorigin="50 -50" >
<!--X轴-->
<v:Line style="Z-INDEX:3" from="-30,0" to="30,0" strokecolor="blue" strokeweight="1pt">
<v:stroke endarrow="classic" dashstyle="dashdot">
</v:stroke>
</v:Line>
<!--Y轴-->
<v:Line style="Z-INDEX:8" from="0,-20" to="0,20" strokecolor="blue" strokeweight="1pt">
<v:stroke endarrow="classic" dashstyle="dashdot">
</v:stroke>
</v:Line>
<v:roundrect style='left:-20;top:-20;width:18;height:10;' fillcolor="red">
<v:textbox inset="0px,-40px,0px,0px">
<a href="http://www.msdn.com/"><font size=2>Click here</font></a>
</v:textbox>
</v:roundrect>
</v:Group>
</body>
</html>
------------------------------
我试了下: inset中的四个参数中分别是:left、top、width和height
再次谢谢 bguest(bguest)!
- (借地方存个帖子)急:请教一个vml中文字摆放位置的问题
- 关于相对布局中控件摆放位置的一个需要注意的小地方
- 请教一个列表控件的问题!急!!!
- 请教各位大神一个PHP问题(急)
- 请教各位高手一个从数据库中取出图片另存的问题!
- 关于pop-up 的问题 请教 急!!!
- 请教关于上网和局域网不通的问题,急!!急!!!
- js文件摆放的位置问题
- 请教各位大神一个关于安卓开发里面的web服务器的问题 急~~~
- 急急急!!!请教一个关于ASP不报错的问题!浪费一下午的时间啊。。。。。。
- 急急急!!!请教一个关于ASP不报错的问题!浪费一下午的时间啊。。。。。。
- 向各位大侠请教一个c++图形方面的问题,急!!!
- android 请教各位大神一个用线程自动刷新 listview 的问题,在线等。急!!
- 请教一个c++涉及图形编程问题,,,急``
- asp.net问题,请教,急!!!
- 急!求救!!!请教关于sql server启动的问题
- 急!请教个WEB的问题 :当输入姓名时,下面就会自动出现其资料。
- 请教!~请教一个问题!~~~~~~~
- 华人姓氏来源
- google暴库问题,有些不解?大家看看都怎么看的?
- 在自己Blog的导航菜单加动态摄影作品展
- 在Windows2000中配置Resin服务器(IIS5.0+resin-2.0.5)
- 关于我的姓——袁(1)
- (借地方存个帖子)急:请教一个vml中文字摆放位置的问题
- 夜幕下的程序员
- 改变一生的五句话
- 关于我的姓氏——袁(2)
- 关于.net的东西
- 在Windows2000中配置Resin服务器(IIS5.0+resin-2.0.5)
- Golden Rules for Windows 2000-Test
- feeling Mozilla 1.7 & Firefox
- 关于vml group的大小和coordsize的关系