html设定按钮位置示例

来源:互联网 发布:linux鼠标切出来 编辑:程序博客网 时间:2024/05/16 14:12

在html中设置一个按钮的位置,可以通过设置margin-left, margin-top这些属性来实现,如我们要将一个按钮放到离上边和左边各500像素的地方,参考代码为:

<input id="Mybutton" style="margin-left:500px;margin-top:500px" type=button color="red" value="联系我们" onclick="window.open('sub1.html')">

关键代码如红色部分所示。


如果是在DIV中则可用下面方式来实现:

style="padding-left:距离px;" 

0 0
原创粉丝点击