帮我写一个使用bootstrap的动态的风景网站
时间: 2023-05-13 14:05:50 浏览: 145
当然可以!使用Bootstrap可以轻松地创建动态的风景网站。以下是一个简单的示例代码:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dynamic Scenery Website</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
.jumbotron {
background-image: url("https://www.w3schools.com/w3images/forestbridge.jpg");
height: 500px;
background-size: cover;
background-position: center;
color: white;
text-shadow: 2px 2px 4px #000000;
}
.bg-1 {
background-image: url("https://www.w3schools.com/w3images/mountains.jpg");
height: 500px;
background-size: cover;
background-position: center;
color: white;
text-shadow: 2px 2px 4px #000000;
}
.bg-2 {
background-image: url("https://www.w3schools.com/w3images/rocks.jpg");
height: 500px;
background-size: cover;
background-position: center;
color: white;
text-shadow: 2px 2px 4px #000000;
}
.bg-3 {
background-image: url("https://www.w3schools.com/w3images/forest.jpg");
height: 500px;
background-size: cover;
background-position: center;
color: white;
text-shadow: 2px 2px 4px #000000;
}
</style>
</head>
<body>
<div class="jumbotron text-center">
<h1>Dynamic Scenery Website</h1>
<p>Enjoy the beauty of nature!</p>
</div>
<div class="container-fluid bg-1 text-center">
<h3>Mountain View</h3>
<p>Some text about the mountain view...</p>
<img src="https://www.w3schools.com/w3images/mountains.jpg" class="img-responsive" style="display:inline" alt="Mountain View" width="600" height="400">
</div>
<div class="container-fluid bg-2 text-center">
<h3>Rocky Beach</h3>
<p>Some text about the rocky beach...</p>
<img src="https://www.w3schools.com/w3images/rocks.jpg" class="img-responsive" style="display:inline" alt="Rocky Beach" width="600" height="400">
</div>
<div class="container-fluid bg-3 text-center">
<h3>Forest</h3>
<p>Some text about the forest...</p>
<img src="https://www.w3schools.com/w3images/forest.jpg" class="img-responsive" style="display:inline" alt="Forest" width="600" height="400">
</div>
</body>
</html>
```
这个网站使用了Bootstrap的网格系统,使得页面可以自适应不同的屏幕大小。同时,使用了背景图片和响应式图片,使得网站更加动态和美观。
阅读全文