<!DOCTYPE html>
<html lang="en"><head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
#img{/*背景图*/
background-image: url(1.jpeg);
}
.log{/*文本框*/
width: 300px;
height: 40px;
margin: 15px 10px 10px 10px;/*上 右 下 左,两个文本框的边距*/
text-indent: 10px;
}
.box{/*盒子*/
width: 399px;
height: 279px;
border-radius: 4px;
border: 5px solid green;
border-color: transparent;
padding: 25px;
margin: 25px;
position: absolute;
left: 780px;
top: 150px;
background-color: white;
}
.butt{/*登录按钮*/
width: 300px;
height: 50px;
margin: 10px 10px 10px 10px;
background-color: rgba(134,206,47,1.00);
}
a:hover{
position: absolute;
left: 368px;
top: 295px;
font-size: 15px;
text-decoration:none; /*鼠标放上去有下划线*/
}
</style>
</head>
<body id="img">
<div>
<div class="text" style="text-align: center">
<h1>欢迎你的到来</h1>
<div>
<p>登录</p><hr>
</div>
<div class="box">
<form action="" method="post">
<input type="text" name="ID" placeholder="学号" class="log"><br>
<input type="text" name="name" placeholder=" 姓名" class="log"><br>
<input type="submit" value="登录" class="butt">
<a href="#">意见反馈</a>
<a href="#" style="left: 293px;top: 295px">注册账号</a>
<a href="#" style="left: 218px;top: 295px">忘记密码</a>
</form>
</div>
</div>
</div>
</body>
</html>

为什么我的<a>内容不对齐
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- threenewbee 2019-07-28 22:06关注
因为你是居中对齐,加上换行,否则和登录挤一起了。
<br /> <a href="#">意见反馈</a> <br /> <a href="#" style="left: 293px;top: 295px">注册账号</a> <br /> <a href="#" style="left: 218px;top: 295px">忘记密码</a>
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报