代码生成(用bootstrap制作旅游网站)
时间: 2023-07-28 07:07:34 浏览: 113
很好的问题!下面是使用Bootstrap制作旅游网站的代码示例:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Travel Website</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha512-p3aP0bQO1V1eAd0lC+eM+XWwG8BzHr9LnSx3eP1mQFWkXoYnCm4Y9kWt1W+5uZudqJ8IA3MvMlyDd1Mv7w2p8g==" crossorigin="anonymous" />
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Travel Website</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Destinations</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</ul>
</div>
</nav>
<!-- Jumbotron -->
<div class="jumbotron jumbotron-fluid">
<div class="container">
<h1 class="display-4">Welcome to our Travel Website!</h1>
<p class="lead">Explore new destinations and make unforgettable memories with us.</p>
<a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a>
</div>
</div>
<!-- Destinations -->
<div class="container">
<h2 class="text-center my-5">Our Destinations</h2>
<div class="row">
<div class="col-lg-4 col-md-6 mb-4">
<div class="card h-100">
<img class="card-img-top" src="https://via.placeholder.com/350x200" alt="">
<div class="card-body">
<h4 class="card-title">Destination 1</h4>
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam auctor elit ac lorem bibendum, eget egestas nisl faucibus.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 mb-4">
<div class="card h-100">
<img class="card-img-top" src="https://via.placeholder.com/350x200" alt="">
<div class="card-body">
<h4 class="card-title">Destination 2</h4>
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam auctor elit ac lorem bibendum, eget egestas nisl faucibus.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 mb-4">
<div class="card h-100">
<img class="card-img-top" src="https://via.placeholder.com/350x200" alt="">
<div class="card-body">
<h4 class="card-title">Destination 3</h4>
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam auctor elit ac lorem bibendum, eget egestas nisl faucibus.</p>
</div>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="py-5 bg-light">
<div class="container">
<p class="m-0 text-center">© 2020 Travel Website</p>
</div>
</footer>
<!-- Bootstrap JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-H+8eCtT+ar9+n6L3z/3Cq3F9T6D5kZBa6JyK4UZIVGK0F9SfG8kgr2aXaTG5Gw/hhRQsN5vKS9hpdSo/uLnigQ==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha512-HRXsK9FtO0/X+8sLRn7C9rVjE5v7eL0Kj04TZqvyo9UxQ/23+Jt3r4HJ3PZs7Kj5fV5Kp5DwRQDZQzG7eRk7Cw==" crossorigin="anonymous"></script>
</body>
</html>
这是一个简单的HTML文件,其中包含一个导航栏、一个Jumbotron(用于展示网站的主要信息)以及三个目的地卡片。这个网站使用Bootstrap框架来实现响应式设计,适应不同屏幕大小的设备。同时,它还使用了一些CSS样式来美化网站的外观。
阅读全文