代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>第一次测试:bootstrap</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/js/bootstrap.bundle.min.js"></script>
<style type="text/css">
.input-group{
width: 600px;
}
</style>
</head>
<body>
<div class="container mt-3">
<p class="h1">请登录</p>
<br>
<form>
<div class="input-group">
<span class="input-group-text">@</span>
<input type="text" class="form-control" placeholder="用户名">
</div>
<div class="input-group">
<span class="input-group-text">@</span>
<input type="text" class="form-control" placeholder="密码">
</div>
</form>
<br/>
<button type="button" class="btn btn-primary" >登录</button>
<button type="button" class="btn btn-warning">取消</button>
</div>
</body>
</html>
运行结果:
![](https://i-blog.csdnimg.cn/blog_migrate/283e7122f00f589f1920e284970aa87d.png)