拟态UI个人博客 HTML+JS+CSS 代码示例
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>拟态UI个人博客</title>
<style>
/* CSS代码 */
body {
background-color: #f0f0f0;
font-family: Arial, sans-serif;
}
<pre><code> .container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.card {
background-color: #fff;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
border-radius: 10px;
padding: 20px;
margin-bottom: 20px;
}
.card-title {
font-size: 24px;
font-weight: bold;
margin-bottom: 10px;
}
.card-content {
font-size: 16px;
line-height: 1.5;
}
.button {
background-color: #007bff;
color: #fff;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
}
.button:hover {
background-color: #0056b3;
}
</style>
</code></pre>
</head>
<body>
<div class='container'>
<div class='card'>
<h2 class='card-title'>个人博客</h2>
<p class='card-content'>欢迎访问我的个人博客!这里是我记录生活和技术的地方。</p>
<button class='button'>查看更多</button>
</div>
<pre><code> <div class='card'>
<h2 class='card-title'>最新文章</h2>
<ul class='card-content'>
<li>文章1</li>
<li>文章2</li>
<li>文章3</li>
</ul>
</div>
<div class='card'>
<h2 class='card-title'>关于我</h2>
<p class='card-content'>我是一个Web开发者,热爱学习和分享。欢迎与我联系!</p>
<button class='button'>联系我</button>
</div>
</div>
</code></pre>
</body>
</html>
<p>上面的代码中,我们使用了CSS来定义拟态UI的样式,使用了HTML来创建博客的结构,没有单独引入外部的CSS和JS文件,而是将它们直接写在了HTML文件中。</p>
<p>你可以将上面的代码复制到一个新建的HTML文件中,然后用浏览器打开,就可以看到一个简单的拟态UI个人博客页面了。</p>
<p>当然,这只是一个简单的示例,你可以根据自己的需求进行修改和扩展。希望对你有帮助!</p>
原文地址: https://www.cveoy.top/t/topic/bxLO 著作权归作者所有。请勿转载和采集!