需要电影网页设计css的格式代码
时间: 2023-12-11 22:06:01 浏览: 27
好的,下面是一个简单的电影网站CSS样式代码,你可以根据自己的需求进行修改:
```css
/* 重置默认样式 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* 头部样式 */
header {
background-color: #333;
color: #fff;
padding: 10px 20px;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo a {
color: #fff;
font-size: 24px;
font-weight: bold;
text-decoration: none;
}
nav ul {
list-style: none;
display: flex;
}
nav li {
margin-left: 20px;
}
nav a {
color: #fff;
text-decoration: none;
}
.search form {
display: flex;
}
.search input[type="text"] {
padding: 5px;
border: none;
border-radius: 5px 0 0 5px;
}
.search button[type="submit"] {
padding: 5px 10px;
background-color: #fff;
color: #333;
border: none;
border-radius: 0 5px 5px 0;
cursor: pointer;
}
/* 主体样式 */
main {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.categories h2 {
font-size: 24px;
font-weight: bold;
margin-bottom: 10px;
}
.categories ul {
list-style: none;
display: flex;
flex-wrap: wrap;
}
.categories li {
margin-right: 20px;
margin-bottom: 10px;
}
.categories a {
color: #333;
text-decoration: none;
}
.movies h2 {
font-size: 24px;
font-weight: bold;
margin-bottom: 10px;
}
.movies ul {
list-style: none;
display: flex;
flex-wrap: wrap;
}
.movies li {
margin-right: 20px;
margin-bottom: 20px;
width: 240px;
}
.movies a {
color: #333;
text-decoration: none;
display: block;
}
.movies img {
width: 100%;
height: auto;
margin-bottom: 10px;
}
.movies h3 {
font-size: 18px;
font-weight: bold;
margin-bottom: 5px;
}
.movie-details h2 {
font-size: 24px;
font-weight: bold;
margin-bottom: 10px;
}
.movie-details h3 {
font-size: 20px;
font-weight: bold;
margin-bottom: 10px;
}
.movie-details p {
margin-bottom: 10px;
}
/* 底部样式 */
footer {
background-color: #333;
color: #fff;
padding: 10px 20px;
text-align: center;
}
footer p {
margin-bottom: 5px;
}
```
以上CSS样式代码只是一个简单的示例,实际上电影网站的CSS样式需要根据具体的需求进行设计和开发。