需要准备的材料分别有:电脑、浏慎派凯览器、html编辑器。
1、首先,打开html编辑器,新建html文件,例如:index.html。
2、在index.html中的<body>标签中,输入html代码:<button style="position: absoluteleft: 250pxtop: 40px">按钮</button>。
3、浏览羡猛器运行index.html页面,此时按钮被宽唤固定在距离上方40px,左侧250px的位置。
id你自己想怎么取就怎么取啊,class的话余亮咐是css里面定义的class,例如:
<!DOCTYPE html>竖纯<html>
<head>
<meta charset="utf-8">
<title>菜鸟键则教程(runoob.com)</title>
<style>
.center
{
text-align:center
}
</style>
</head>
<body>
<h1 class="center">标题居中</h1>
<p class="center">段落居中。</p>
</body>
</html>
class取的就是css里面定义的center
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)