当前位置: 移动技术网 > IT编程>网页制作>CSS > Rect,RoundRect(矩形)对象

Rect,RoundRect(矩形)对象

2017年12月12日  | 移动技术网IT编程  | 我要评论
用vml画矩形,必须设置 style="width:50;height:50",其他就没有什么特别的。在这节,顺便讲讲 shadow 对象和 textbox对象:
    <v:rect style="position:relative;width:100;height:50px"/>
    roundrect顾名思义,是圆角的矩形,这种形状在画流程图的时候很常用,如果加上阴影,就更好看了:
    <v:roundrect style="position:relative;width:100;height:50px">
    <v:shadow on="t" type="single" color="#b3b3b3" offset="5px,5px"/>
    </v:roundrect>

    在vml里面,true 和 false 可以简写成 t 和 f。shadow 中的 offset 属性用来设置 偏移原图的 x,y 值。 on 属性用来决定是否显示阴影。在矩形中写字,要用到 textbox 对象。textbox 比较关键的属性是 inset(left,top,right,bottom),意思是隔图形边的上下左右多少范围内定位文字:
    <v:roundrect style="position:relative;width:120;height:50px">
    <v:shadow on="t" type="single" color="#b3b3b3" offset="5px,5px"/>
    <v:textbox inset="5pt,5pt,5pt,5pt" style="font-size:10.2pt;">hello world!</v:textbox>
    </v:roundrect>
hello world!

    当然你也可以直接插入html代码,比如说插入一个
<div style="padding-top:5px;padding-left:5px;padding-right:5px;padding-bottom:5px">hello world!</div>
效果是一样的。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网