Skip to content

Commit

Permalink
Img border fix (#35)
Browse files Browse the repository at this point in the history
* Fix for images in the Page layouts don't have clear borders on all 4 sides

* Remove width hard coding
  • Loading branch information
mewim authored Mar 27, 2024
1 parent c494a71 commit 15d6e4f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/layouts/Posts.astro
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,18 @@ type PostType = {
{
posts?.slice(0, config.site.pageSize).map((post: PostType) => (
<article class="flex w-full flex-col items-start">
<div class="rounded overflow-hidden isolate mb-4">
<div class="rounded overflow-hidden isolate mb-4" style="width: 100%;">
{post.data.heroImage && (
<a href={`/post/${post.slug}/`}>
<center>
<figure class="max-w-96 h-40 block bg-white border-2 border-zinc-200">
<Image
<img
class="max-w-96 h-36 block bg-white border-2 border-zinc-200"
src={post.data.heroImage}
alt={post.data.title}
width={960}
height={480}
decoding="async"
loading="lazy"
style="width: 100%; height:200px; object-fit: cover;"
/>
</figure>
</center>
</a>
)}
Expand Down

0 comments on commit 15d6e4f

Please sign in to comment.