这个个人中心网页的CSS代码
时间: 2023-09-07 22:15:04 浏览: 48
好的,以下是个人中心页面的 CSS 代码示例:
```css
/* 全局样式 */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
font-size: 16px;
line-height: 1.5;
color: #333;
background-color: #f2f2f2;
}
a {
color: #007bff;
text-decoration: none;
}
ul {
list-style: none;
}
/* 头部样式 */
header {
background-color: #fff;
height: 80px;
padding: 0 20px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
display: flex;
justify-content: space-between;
align-items: center;
}
header h1 {
font-size: 24px;
font-weight: bold;
}
nav ul {
display: flex;
}
nav li {
margin-right: 20px;
}
nav a {
display: block;
padding: 10px;
}
nav a:hover {
background-color: #f2f2f2;
}
/* 主体样式 */
main {
max-width: 960px;
margin: 20px auto;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
section {
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
padding: 20px;
margin-bottom: 20px;
flex-basis: 48%;
}
section h2 {
font-size: 20px;
font-weight: bold;
margin-bottom: 10px;
}
section ul {
margin-left: 20px;
}
section li {
margin-bottom: 10px;
}
section p {
margin-bottom: 5px;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-bottom: 10px;
}
input[type="text"],
input[type="email"],
input[type="password"] {
padding: 10px;
margin-bottom: 20px;
border: 1px solid #ccc;
border-radius: 4px;
}
button[type="submit"] {
background-color: #007bff;
color: #fff;
padding: 10px;
border: none;
border-radius: 4px;
cursor: pointer;
}
button[type="submit"]:hover {
background-color: #0069d9;
}
/* 底部样式 */
footer {
background-color: #fff;
height: 60px;
padding: 10px 20px;
box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
display: flex;
justify-content: center;
align-items: center;
}
footer p {
font-size: 14px;
color: #999;
}
```
其中包含了一些全局样式,如重置样式、字体和颜色等。头部样式包含了背景色、高度、阴影、对齐方式和导航样式等。主体样式包含了最大宽度、内外边距、背景色、阴影、对齐方式、表单样式等。底部样式包含了背景色、高度、阴影、对齐方式和版权信息样式等。你可以根据自己的需求进行修改和适配。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)