html怎样将一个注册框放到中间

html怎样将一个注册框放到中间,第1张

这个其实很简单的,只要添加一条

标签就能让其居中

把你登录的id和密码还有下边的按钮放到一个div里,给这个div设置margin:0 auto就居中了。

这个其实很简单的,只要添加一条

标签就能让其居中 这个是html5的标签,兼容性不好,还是用div+css2吧。

网页内容默认是从左到右,如果要放在中间:

1、简单快捷方法就是加<center>内容</center>标签。

示例:

<html>

<head>

<meta http-equiv="Content-Type" content="text/html charset=gb2312" />

<title>center居中</title>

</head>

<body>

<center>我要居中</center>

</body>

</html>

2、margin-left:550px意思是距离左边550px,自己调节居中即可。

示例:

<html>

<head>

<meta http-equiv="Content-Type" content="text/html charset=gb2312" />

<title>margin居中</title>

<style type="text/css">

.d1{

border:1px solid red

width:200px

height:200px

text-align:center

line-height:40px

margin-left:550px

}

</style>

</head>

<body>

<div class="d1">

我要居中

</div>

</body>

</html>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/7080366.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-01
下一篇 2023-04-01

发表评论

登录后才能评论

评论列表(0条)

保存