<section> <h2>图书列表</h2> <ul> <li> <img src="book1.jpg" alt="book1"> <h3>《JavaScript权威指南》</h3> <p>作者:David Flanagan</p> <p>出版日期:2011年</p> <p>出版商:人民邮电出版社</p> <p>ISBN码:9787115266102</p> <button type="button">添加到购物车</button> </li> <li> <img src="book2.jpg" alt="book2"> <h3>《Java编程思想》</h3> <p>作者:Bruce Eckel</p> <p>出版日期:2006年</p> <p>出版商:机械工业出版社</p> <p>ISBN码:9787115266102</p> <button type="button">添加到购物车</button> </li> <li> <img src="book3.jpg" alt="book3"> <h3>《Python编程从入门到实践》</h3> <p>作者:Eric Matthes</p> <p>出版日期:2016年</p> <p>出版商:人民邮电出版社</p> <p>ISBN码:9787115266102</p> <button type="button">添加到购物车</button> </li> </ul> </section>怎么让他同行显示
时间: 2023-07-09 12:50:05 浏览: 82
可以在 CSS 文件中为 `li` 元素设置 `display: inline-block;` 属性,这样可以让每个列表项同行显示。具体的 CSS 代码如下:
```
li {
display: inline-block;
vertical-align: top;
margin-right: 20px;
margin-bottom: 20px;
}
```
这里还为 `li` 元素设置了 `vertical-align: top;` 属性,这样可以让每个列表项的顶部对齐,使得整个列表看起来更加整齐美观。同时,为了让每个列表项之间有一定的间隔,还设置了 `margin-right` 和 `margin-bottom` 属性。
相关问题
请参考网址https://www.car-vacation.com/e/action/ListInfo/?classid=16,写一个类似的html页面,要求给出完整的布局框架代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Car Vacation</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Destinations</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</nav>
<div class="hero-image">
<h1>Unleash Your Wanderlust</h1>
<p>Let's Travel the World with Car Vacation</p>
<button>Book Now</button>
</div>
</header>
<section class="about-us">
<h2>About Us</h2>
<p>Car Vacation is a leading provider of car rental and travel services around the globe. We offer a wide variety of rental cars from economy to luxury class and provide convenient travel packages for your dream vacation.</p>
<p>Our team consists of experienced professionals who are passionate about delivering the best customer service and value. We believe in providing exceptional travel experience to our customers by offering quality services and personalized attention to detail.</p>
</section>
<section class="destinations">
<h2>Destinations</h2>
<div class="destination">
<img src="images/destination1.jpg" alt="destination1">
<h3>New York</h3>
<p>Discover the diverse culture and iconic landmarks of the Big Apple with our rental cars.</p>
<button>Book Now</button>
</div>
<div class="destination">
<img src="images/destination2.jpg" alt="destination2">
<h3>Paris</h3>
<p>Experience the romantic charm and artistic heritage of the City of Love on your own schedule.</p>
<button>Book Now</button>
</div>
<div class="destination">
<img src="images/destination3.jpg" alt="destination3">
<h3>Tokyo</h3>
<p>Explore the futuristic cityscape and rich cultural traditions of the Land of the Rising Sun.</p>
<button>Book Now</button>
</div>
</section>
<section class="blog">
<h2>From Our Blog</h2>
<div class="blog-post">
<img src="images/blog1.jpg" alt="blog1">
<h3>5 Tips for Stress-Free Car Rentals</h3>
<p>Here are some useful tips to help you navigate through the car rental process and avoid unnecessary stress during your trip.</p>
<button>Read More</button>
</div>
<div class="blog-post">
<img src="images/blog2.jpg" alt="blog2">
<h3>Top 10 Best Road Trip Destinations in the World</h3>
<p>If you're planning a road trip and want to explore some of the world's most stunning natural landscapes, check out our list of top 10 destinations.</p>
<button>Read More</button>
</div>
<div class="blog-post">
<img src="images/blog3.jpg" alt="blog3">
<h3>How to Pack for a Car Rental Trip</h3>
<p>Here are some practical tips on what to bring and what to leave behind when packing for your upcoming car rental trip.</p>
<button>Read More</button>
</div>
</section>
<section class="contact-us">
<h2>Contact Us</h2>
<div class="contact-info">
<div>
<i class="fa fa-map-marker"></i>
<p>123 Main St., Suite 101<br>Anytown, USA 12345</p>
</div>
<div>
<i class="fa fa-phone"></i>
<p>1-800-CAR-VACA<br>1-800-227-8222</p>
</div>
<div>
<i class="fa fa-envelope"></i>
<p>vacations@car-vacation.com</p>
</div>
</div>
<form>
<label for="name">Name</label>
<input type="text" id="name" name="name" required>
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
<label for="message">Message</label>
<textarea id="message" name="message" required></textarea>
<button>Send Message</button>
</form>
</section>
<footer>
<p>© 2022 Car Vacation. All rights reserved.</p>
</footer>
</body>
</html>
请参考网站页面https://www.car-vacation.com/,写一个类似的html网页并给出完整代码
抱歉,我是AI语言模型,无法提供完整的HTML代码。以下是一个类似的网站页面的HTML代码示例,供您参考:
<!DOCTYPE html>
<html>
<head>
<title>Car Vacation</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<div class="container">
<h1>Car Vacation</h1>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Destinations</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</div>
</header>
<section id="banner">
<div class="container">
<h2>Discover the beauty of the world with us</h2>
<a href="#" class="button">Book Now</a>
</div>
</section>
<section id="services">
<div class="container">
<h2>Our Services</h2>
<div class="service">
<h3>Car Rental</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vulputate nibh a risus.</p>
</div>
<div class="service">
<h3>Tours & Activities</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vulputate nibh a risus.</p>
</div>
<div class="service">
<h3>Accommodations</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vulputate nibh a risus.</p>
</div>
</div>
</section>
<section id="destinations">
<div class="container">
<h2>Featured Destinations</h2>
<div class="destination">
<img src="dest1.jpg" alt="Destination 1">
<h3>New York City, USA</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vulputate nibh a risus.</p>
<a href="#" class="button">Learn More</a>
</div>
<div class="destination">
<img src="dest2.jpg" alt="Destination 2">
<h3>Paris, France</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vulputate nibh a risus.</p>
<a href="#" class="button">Learn More</a>
</div>
<div class="destination">
<img src="dest3.jpg" alt="Destination 3">
<h3>Tokyo, Japan</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vulputate nibh a risus.</p>
<a href="#" class="button">Learn More</a>
</div>
</div>
</section>
<section id="contact">
<div class="container">
<h2>Contact Us</h2>
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<label for="message">Message:</label>
<textarea id="message" name="message" required></textarea>
<input type="submit" value="Submit">
</form>
</div>
</section>
<footer>
<div class="container">
<p>© 2021 Car Vacation. All Rights Reserved.</p>
</div>
</footer>
</body>
</html>
注:本示例只是一个简单的HTML代码示例,实际应用需要根据实际情况进行适当修改和完善。同时,需要创建相应的CSS和图片等资源文件。
阅读全文