用html+css写一个个人博客
时间: 2023-05-17 15:06:55 浏览: 124
当然可以,以下是一个简单的示例:
<!DOCTYPE html>
<html>
<head>
<title>My Personal Blog</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
}
header {
background-color: #333;
color: #fff;
padding: 20px;
text-align: center;
}
h1 {
margin-top: 0;
}
nav {
background-color: #f2f2f2;
padding: 10px;
text-align: center;
}
nav a {
display: inline-block;
padding: 10px;
color: #333;
text-decoration: none;
font-weight: bold;
}
nav a:hover {
background-color: #333;
color: #fff;
}
section {
background-color: #fff;
padding: 20px;
margin: 10px;
}
footer {
background-color: #333;
color: #fff;
padding: 10px;
text-align: center;
}
</style>
</head>
<body>
<header>
<h1>My Personal Blog</h1>
</header>
<nav>
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Contact</a>
</nav>
<section>
<h2>Welcome to my blog!</h2>
<p>This is where I share my thoughts and ideas about various topics.</p>
<p>Stay tuned for more updates!</p>
</section>
<footer>
<p>© 2021 My Personal Blog</p>
</footer>
</body>
</html>
阅读全文