Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions src/blog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>blog - my blog</title>
<link rel="stylesheet" href="../styles/blog.css">
</head>
<body>
<header>
<nav>
<h1>my blog</h1>
<ul>
<li><a href="index.html">home</a></li>
<li><a href="blog.html">blog</a></li>
<li><a href="contact.html">contact us</a></li>
</ul>
</nav>
</header>

<main>
<section class="blog-header">
<h2>all blog posts</h2>
<p>explore our latest articles and insights</p>
</section>

<section class="blog-posts">
<article class="blog-post">
<div class="post-meta">
<span class="date">january 15, 2025</span>
<span class="category">technology</span>
</div>
<h3>getting started with web development</h3>
<img src="https://via.placeholder.com/600x300" alt="web development image">
<p>web development is an exciting field that combines creativity with technical skills. in this post, we'll explore the basics of html, css, and javascript...</p>
<a href="#" class="read-more">read more</a>
</article>

<article class="blog-post">
<div class="post-meta">
<span class="date">january 12, 2025</span>
<span class="category">design</span>
</div>
<h3>the importance of responsive design</h3>
<img src="https://via.placeholder.com/600x300" alt="responsive design image">
<p>responsive design ensures that your website looks great on all devices. learn about the key principles and techniques for creating mobile-friendly websites...</p>
<a href="#" class="read-more">read more</a>
</article>

<article class="blog-post">
<div class="post-meta">
<span class="date">january 10, 2025</span>
<span class="category">tutorial</span>
</div>
<h3>css grid vs flexbox: when to use what</h3>
<img src="https://via.placeholder.com/600x300" alt="css layout image">
<p>understanding when to use css grid versus flexbox can greatly improve your layout skills. this guide will help you make the right choice for your projects...</p>
<a href="#" class="read-more">read more</a>
</article>
</section>

<aside class="sidebar">
<div class="widget">
<h4>recent posts</h4>
<ul>
<li><a href="#">getting started with web development</a></li>
<li><a href="#">the importance of responsive design</a></li>
<li><a href="#">css grid vs flexbox</a></li>
</ul>
</div>

<div class="widget">
<h4>categories</h4>
<ul>
<li><a href="#">technology</a></li>
<li><a href="#">design</a></li>
<li><a href="#">tutorial</a></li>
</ul>
</div>
</aside>
</main>

<footer>
<p>&copy; 2025 my blog. all rights reserved.</p>
</footer>
</body>
</html>
201 changes: 201 additions & 0 deletions styles/blog.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: arial, sans-serif;
line-height: 1.6;
color: #333;
background-color: #f8f9fa;
}

header {
background-color: #2c3e50;
color: white;
padding: 1rem 0;
}

nav {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1200px;
margin: 0 auto;
padding: 0 2rem;
}

nav ul {
list-style: none;
display: flex;
gap: 2rem;
}

nav a {
color: white;
text-decoration: none;
transition: color 0.3s ease;
}

nav a:hover {
color: #3498db;
}

.blog-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
text-align: center;
padding: 3rem 2rem;
}

.blog-header h2 {
font-size: 2.5rem;
margin-bottom: 1rem;
}

main {
display: grid;
grid-template-columns: 2fr 1fr;
gap: 3rem;
max-width: 1200px;
margin: 3rem auto;
padding: 0 2rem;
}

.blog-posts {
display: flex;
flex-direction: column;
gap: 3rem;
}

.blog-post {
background: white;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
transition: transform 0.3s ease;
}

.blog-post:hover {
transform: translateY(-5px);
}

.post-meta {
padding: 1rem;
background-color: #ecf0f1;
display: flex;
gap: 1rem;
font-size: 0.9rem;
color: #7f8c8d;
}

.category {
background-color: #3498db;
color: white;
padding: 0.2rem 0.8rem;
border-radius: 15px;
font-size: 0.8rem;
}

.blog-post h3 {
padding: 1rem;
font-size: 1.5rem;
color: #2c3e50;
}

.blog-post img {
width: 100%;
height: 250px;
object-fit: cover;
}

.blog-post p {
padding: 1rem;
color: #555;
}

.read-more {
display: inline-block;
margin: 0 1rem 1rem;
padding: 0.8rem 1.5rem;
background-color: #3498db;
color: white;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s ease;
}

.read-more:hover {
background-color: #2980b9;
}

.sidebar {
display: flex;
flex-direction: column;
gap: 2rem;
}

.widget {
background: white;
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.widget h4 {
margin-bottom: 1rem;
color: #2c3e50;
font-size: 1.2rem;
}

.widget ul {
list-style: none;
}

.widget ul li {
padding: 0.5rem 0;
border-bottom: 1px solid #ecf0f1;
}

.widget ul li:last-child {
border-bottom: none;
}

.widget a {
color: #555;
text-decoration: none;
transition: color 0.3s ease;
}

.widget a:hover {
color: #3498db;
}

footer {
background-color: #2c3e50;
color: white;
text-align: center;
padding: 2rem 0;
margin-top: 4rem;
}

@media (max-width: 768px) {
main {
grid-template-columns: 1fr;
gap: 2rem;
}

.blog-header h2 {
font-size: 2rem;
}

nav {
flex-direction: column;
gap: 1rem;
}

nav ul {
gap: 1rem;
}
}