CSS(Cascading Style Sheets)是一种样式表语言,用于描述HTML或XML(包括SVG、MathML等各种XML方言)文档的外观和格式。CSS模板则是预先设计好的一组CSS样式,可以快速应用于网站或应用,以实现统一和专业的外观。
以下是一个简单的CSS模板示例:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Template Example</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>Welcome to My Website</h1>
</header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
<main>
<p>This is the main content of the website.</p>
</main>
<footer>
<p>© 2023 My Website. All rights reserved.</p>
</footer>
</body>
</html>/* styles.css */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
header {
background-color: #333;
color: #fff;
padding: 1em 0;
text-align: center;
}
nav ul {
list-style-type: none;
margin: 0;
padding: 0;
background-color: #f4f4f4;
text-align: center;
}
nav ul li {
display: inline;
margin-right: 10px;
}
nav ul li a {
text-decoration: none;
color: #333;
padding: 0.5em 1em;
}
main {
padding: 20px;
}
footer {
background-color: #333;
color: #fff;
text-align: center;
padding: 1em 0;
position: fixed;
bottom: 0;
width: 100%;
}没有搜到相关的文章