(借地方存个帖子)急:请教一个vml中文字摆放位置的问题
2004-07-17 23:44
453 查看
我需要在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)!
请大家帮我看看出错在哪。我试了下 该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)!
相关文章推荐
- 这是我在逛一个微波论坛的时候看到的一些帖子里面对HFSS仿真的一些问题的解决方法,不一定正确,有不对的地方希望指出,我改正!
- 关于相对布局中控件摆放位置的一个需要注意的小地方
- 请教一个问题,Log4Net记录日志到Oracle显示中文乱码如何解决?
- servlet从服务器磁盘文件读出到浏览器显示,中文乱码问题,不要忘记在输入流和输出流都要设置编码格式,否则一个地方没设置不统一就会各种乱码
- 请教一个MVC问题
- 请教一个问题!!Delphi高手们请帮忙!!
- 百度笔试题——找出程序中的错误(关于中文字符赋值给char时它是一个负数的问题),今天我是做错了!悲剧了!
- 关于iBatis配置xml文件时出现中文注释出错的一个问题(很坑爹.)
- 一个jsp页面显示的中文问题
- 新手请教一个循环替换问题
- 奇怪问题:使用Request.QueryString传递一个中文参数,结果少了一个字!
- 请教一个pip install 出现报asciii码错误的问题
- 请教一个问题
- 一个将html文件批量转换成jsp文件的程序(主要处理中文乱码问题)
- 哎呀,今天犯了一个大毛病,有串口不打log看,遇到问题就请教别人是个坏毛病
- 请教C语言的一个问题
- Aop多个切面切同一个地方的优先级问题
- 请教一个JAVA问题,对你也许很简单
- 请教一个网站显示错位的问题...