个人主页模板代码 - 简洁美观, 快速创建你的网站
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<title>个人主页</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
margin: 0;
padding: 0;
}
<pre><code> header {
background-color: #333;
color: #fff;
padding: 20px;
text-align: center;
}
h1 {
margin: 0;
}
nav {
background-color: #666;
height: 40px;
display: flex;
justify-content: center;
}
nav ul {
margin: 0;
padding: 0;
list-style: none;
display: flex;
}
nav li {
margin: 0 10px;
}
nav a {
display: block;
color: #fff;
text-decoration: none;
padding: 10px;
transition: background-color 0.2s ease-in-out;
}
nav a:hover {
background-color: #fff;
color: #333;
}
main {
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.profile {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
margin-bottom: 20px;
}
.profile img {
width: 150px;
height: 150px;
border-radius: 50%;
margin-bottom: 10px;
}
.profile h2 {
margin: 0;
font-size: 24px;
text-align: center;
}
.profile p {
margin: 0;
font-size: 18px;
text-align: center;
}
.social-links {
display: flex;
justify-content: center;
align-items: center;
margin-top: 20px;
}
.social-links a {
display: block;
color: #333;
text-decoration: none;
margin: 0 10px;
transition: color 0.2s ease-in-out;
}
.social-links a:hover {
color: #666;
}
footer {
background-color: #333;
color: #fff;
padding: 20px;
text-align: center;
}
</style>
</code></pre>
</head>
<body>
<header>
<h1>个人主页</h1>
</header>
<nav>
<ul>
<li><a href='#'>首页</a></li>
<li><a href='#'>关于我</a></li>
<li><a href='#'>联系我</a></li>
</ul>
</nav>
<main>
<div class='profile'>
<img src='https://via.placeholder.com/150' alt='头像'>
<h2>用户名</h2>
<p>个人简介</p>
</div>
<div class='social-links'>
<a href='#'>Facebook</a>
<a href='#'>Twitter</a>
<a href='#'>Instagram</a>
</div>
</main>
<footer>
<p>版权所有 © 2021</p>
</footer>
</body>
</html>
原文地址: http://www.cveoy.top/t/topic/lvAX 著作权归作者所有。请勿转载和采集!