css好看网站模板:css样式网站

哆啦Ai流程自动化2023-05-18 00:28 1078 浏览
点赞38收藏

以下是一些 CSS 好看网站模板的示例,您可以根据自己的需要进行选择:
1. 扁平化设计:使用简单的颜色和字体,创建一个清晰简洁的网站模板。
```css
/* 扁平化样式表 */
* {
box-sizing: border-box;
}
body {
background-color: #F2F2F2;
font-family: Arial, sans-serif;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}
h1 {
font-size: 36px;
margin-bottom: 20px;
}
h2 {
font-size: 24px;
margin-bottom: 10px;
}
h3 {
font-size: 18px;
margin-bottom: 5px;
}
p {
font-size: 16px;
line-height: 1.6;
margin-bottom: 20px;
}
.header {
background-color: #222;
color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}
.logo {
width: 200px;
height: 50px;
background-image: url('logo.png');
background-size: cover;
background-repeat: no-repeat;
border-radius: 5px;
border: none;
}
.header h1 {
font-size: 32px;
margin-bottom: 30px;
}
.header h2 {
font-size: 20px;
margin-bottom: 10px;
}
.header h3 {
font-size: 14px;
margin-bottom: 5px;
}
.nav {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
background-color: #222;
padding: 20px;
}
.nav ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.nav li {
display: inline-block;
margin-right: 10px;
}
.nav a {
color: #fff;
text-decoration: none;
padding: 10px 20px;
border-radius: 5px;
border: none;
}
.nav a:hover {
background-color: #1a1a1a;
}
.footer {
text-align: center;
padding: 20px;
background-color: #222;
color: #fff;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}
```
2. 响应式网站模板:使用自适应布局,让网站适应不同设备和屏幕大小。
```css
/* 响应式样式表 */
@media screen and (max-width: 768px) {
h1 {
font-size: 28px;
}
h2 {
font-size: 24px;
}
h3 {
font-size: 18px;
}
}
```
3. 渐变背景网站模板:使用渐变色背景,创建一个视觉效果良好的网站模板。
```css
/* 渐变色样式表 */
body {
background-color: #1a1a1a;
background-image: linear-gradient(45deg, #222, #1a1, #1a1);
background-size: cover;
background-repeat: no-repeat;
}
```
这些是 CSS 好看网站模板的一些示例,您可以根据自己的需要进行选择。