!DOCTYPE htmlhtmlhead titleMy Websitetitle style body background-image urlstaticimages4jpg; background-size cover; 添加其他样式 h1
要将第一页按钮放在登录按钮的左边,可以通过调整按钮的样式中的right属性来实现。将第一页按钮的right属性值设为300px,即可将其移动到登录按钮的左边。
修改后的代码如下所示:
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<style>
body {
background-image: url("/static/images/4.jpg");
background-size: cover;
/* 添加其他样式 */
}
h1 {
text-align: center;
font-size: 35px;
color: green;
}
.button-container {
position: relative;
}
.login-button {
width: 150px;
height: 40px;
position: fixed;
top: 0;
right: 0;
}
.firstpage-button {
width: 150px;
height: 40px;
position: fixed;
top: 0;
right: 300px;
}
.register-button {
width: 150px;
height: 40px;
position: fixed;
top: 0;
right: 150px;
}
</style>
</head>
<body>
<h1>欢迎来到智能健康管理系统</h1>
<div class="button-container">
<a href="/login"><button class="login-button">登录</button></a>
<a href="/register"><button class="register-button">注册</button></a>
<a href="/firstpage"><button class="firstpage-button">第一页</button></a>
</div>
</body>
</html>
这样,第一页按钮就会显示在登录按钮的左边了
原文地址: https://www.cveoy.top/t/topic/hWDf 著作权归作者所有。请勿转载和采集!