用bootstrap制作一个好看的搜索页面
时间: 2024-01-21 21:03:36 浏览: 29
好的,以下是一个基本的搜索页面示例代码,使用了Bootstrap框架来实现:
```html
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous">
<title>Search Page</title>
</head>
<body>
<div class="container mt-5">
<form>
<div class="form-group">
<label for="searchInput">Search:</label>
<div class="input-group">
<input type="text" class="form-control" id="searchInput" placeholder="Enter search terms">
<div class="input-group-append">
<button class="btn btn-primary" type="submit">Search</button>
</div>
</div>
</div>
</form>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.3/dist/umd/popper-base.min.js" integrity="sha384-EaESq5bNqzV+0i7N2Jm1uWtN2qg8o8q0HJ8e7vL6/kfWlLlB+0lE8zNwzvkkOZJ6" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
</body>
</html>
```
此代码创建了一个搜索框和一个搜索按钮,使用了Bootstrap的样式和布局。可以根据需要进行自定义和修改。