给我一份精美的个人博客模板
时间: 2023-05-23 16:06:36 浏览: 176
五套十分精美的个人博客模板(html+css+js)
5星 · 资源好评率100%
A:非常感谢您的提问,以下是一个基于HTML、CSS、JavaScript的精美个人博客模板:
```
<!DOCTYPE html>
<html>
<head>
<title>My Blog</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">My Blog</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Blog</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</ul>
</div>
</nav>
<!-- Header -->
<header class="bg-primary text-center py-5">
<h1 class="text-light">Welcome to My Blog</h1>
<p class="text-light">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</header>
<!-- Main Content -->
<main class="container my-5">
<!-- Blog Post 1 -->
<div class="card mb-4">
<img class="card-img-top" src="https://via.placeholder.com/750x300" alt="Blog Post 1">
<div class="card-body">
<h4 class="card-title">Blog Post 1</h4>
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p>
<a href="#" class="btn btn-secondary">Read More</a>
</div>
</div>
<!-- Blog Post 2 -->
<div class="card mb-4">
<img class="card-img-top" src="https://via.placeholder.com/750x300" alt="Blog Post 2">
<div class="card-body">
<h4 class="card-title">Blog Post 2</h4>
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p>
<a href="#" class="btn btn-secondary">Read More</a>
</div>
</div>
<!-- Pagination -->
<div class="d-flex justify-content-center">
<nav aria-label="...">
<ul class="pagination">
<li class="page-item disabled">
<span class="page-link">Previous</span>
</li>
<li class="page-item active">
<a class="page-link" href="#">1</a>
</li>
<li class="page-item">
<a class="page-link" href="#">2</a>
</li>
<li class="page-item">
<a class="page-link" href="#">3</a>
</li>
<li class="page-item">
<a class="page-link" href="#">Next</a>
</li>
</ul>
</nav>
</div>
</main>
<!-- Footer -->
<footer class="bg-light text-center py-3">
<p>Made with <i class="fa fa-heart"></i> by ChitGPT</p>
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>
```
该模板包含一个导航栏、标题图片、两篇博客文章和页码,其中导航栏使用了Bootstrap框架,标题图片和页码使用了placeholder图片和Bootstrap的分页组件,您可以基于此模板进行个性化设置,如更换图片、添加文章等。
阅读全文