用HTML+css写一个图书馆网站
时间: 2023-05-29 19:03:02 浏览: 107
基于HTML+CSS+JavaScript+PHP 实现的图书网站
5星 · 资源好评率100%
抱歉,我是一名语言模型AI,没有办法展示HTML和CSS代码。但是我可以给你提供一个基本的HTML结构和CSS样式,你可以根据这个结构和样式来构建你的图书馆网站。
HTML结构:
```
<!DOCTYPE html>
<html>
<head>
<title>图书馆</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<h1>图书馆</h1>
<nav>
<ul>
<li><a href="#">首页</a></li>
<li><a href="#">图书分类</a></li>
<li><a href="#">我的借阅</a></li>
<li><a href="#">联系我们</a></li>
</ul>
</nav>
</header>
<section class="search">
<form>
<input type="text" name="search" placeholder="搜索书籍">
<button type="submit">搜索</button>
</form>
</section>
<section class="featured">
<h2>特色推荐</h2>
<div class="book">
<img src="book1.jpg" alt="book1">
<h3>书名</h3>
<p>作者</p>
<p>简介</p>
<button>借阅</button>
</div>
<div class="book">
<img src="book2.jpg" alt="book2">
<h3>书名</h3>
<p>作者</p>
<p>简介</p>
<button>借阅</button>
</div>
<div class="book">
<img src="book3.jpg" alt="book3">
<h3>书名</h3>
<p>作者</p>
<p>简介</p>
<button>借阅</button>
</div>
</section>
<section class="categories">
<h2>图书分类</h2>
<ul>
<li><a href="#">小说</a></li>
<li><a href="#">历史</a></li>
<li><a href="#">科技</a></li>
<li><a href="#">教育</a></li>
<li><a href="#">文学</a></li>
<li><a href="#">艺术</a></li>
</ul>
</section>
<footer>
<p>版权 © 2021 图书馆</p>
</footer>
</body>
</html>
```
CSS样式:
```
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
header {
background-color: #333;
color: white;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
}
header h1 {
margin: 0;
}
nav ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
}
nav li {
margin-right: 20px;
}
nav a {
color: white;
text-decoration: none;
}
section.search {
background-color: #eee;
padding: 10px;
display: flex;
justify-content: center;
align-items: center;
}
section.search form {
display: flex;
}
section.search input[type="text"] {
padding: 10px;
border: none;
border-radius: 5px 0 0 5px;
}
section.search button[type="submit"] {
padding: 10px;
background-color: #333;
color: white;
border: none;
border-radius: 0 5px 5px 0;
cursor: pointer;
}
section.featured {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
padding: 20px;
}
section.featured h2 {
text-align: center;
margin-bottom: 20px;
}
.book {
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px;
padding: 10px;
text-align: center;
max-width: 300px;
}
.book img {
max-width: 100%;
}
.book h3 {
margin: 10px 0;
}
.book p {
margin: 5px 0;
}
.book button {
margin-top: 10px;
padding: 10px;
background-color: #333;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
section.categories {
padding: 20px;
}
section.categories h2 {
text-align: center;
margin-bottom: 20px;
}
section.categories ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
}
section.categories li {
margin-right: 20px;
}
section.categories a {
color: #333;
text-decoration: none;
}
footer {
background-color: #333;
color: white;
text-align: center;
padding: 10px;
}
```
阅读全文