-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trialling the layout of the blogheaderder.
need to fix alignment of text
- Loading branch information
Showing
2 changed files
with
79 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
interface Props { | ||
imageUrl: string; | ||
title: string; | ||
datePublished: string; | ||
authorName: string; | ||
content: string; | ||
} | ||
const { imageUrl, title, datePublished, authorName, content } = Astro.props; | ||
--- | ||
|
||
<div class="blog-header"> | ||
<img src={imageUrl} alt={title} class="blog-header__image" /> | ||
<div class="blog-header__text"> | ||
<h1 class="blog-header__title">{title}</h1> | ||
<div class="blog-header__meta"> | ||
<span class="blog-header__author">{authorName}</span> | <span class="blog-header__date">{datePublished}</span> | ||
</div> | ||
<p class="blog-header__content">{content}</p> | ||
</div> | ||
</div> | ||
|
||
<style> | ||
.blog-header { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
padding: 2rem; | ||
text-align: center; | ||
} | ||
|
||
.blog-header__image { | ||
max-width: 100%; | ||
height: auto; | ||
border-radius: 10px; | ||
} | ||
|
||
.blog-header__text { | ||
max-width: 800px; | ||
} | ||
|
||
.blog-header__title { | ||
font-size: 2.5rem; | ||
margin: 1rem 0; | ||
} | ||
|
||
.blog-header__meta { | ||
font-size: 1rem; | ||
color: #6c757d; | ||
} | ||
|
||
.blog-header__author, .blog-header__date { | ||
font-weight: bold; | ||
color: #087DF1; | ||
} | ||
|
||
.blog-header__content { | ||
font-size: 1.25rem; | ||
color: #343a40; | ||
margin-top: 1rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters