Skip to content

Commit aac8407

Browse files
author
Ajay kumar
committed
[Blog] [Ajay]: Fix image caption
1 parent 0408a0f commit aac8407

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

TestArena/Blog/Common/BlogImage.razor

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[Required] [Parameter] public string Description { get; set; }
66
[Parameter] public int Number { get; set; }
77

8-
private string ImageDescription => Number > 0 ? $"{Number}: {Description}" : Description;
8+
private string ImageDescription => Number > 0 ? $"<strong>{Number}</strong>: {Description}" : Description;
99
}
1010

1111
<style>
@@ -24,11 +24,26 @@
2424
padding: 2px;
2525
text-align: center;
2626
}
27+
28+
.figure-caption {
29+
font-size: 0.9rem; /* Adjust caption size */
30+
color: #6c757d; /* Muted text color */
31+
text-align: center; /* Center align */
32+
margin-top: 8px; /* Space between image and caption */
33+
font-weight: 500; /* Slightly bold for readability */
34+
}
35+
36+
.figure-caption strong {
37+
color: #343a40; /* Darker color for image number */
38+
font-weight: 600; /* Make image number bold */
39+
}
2740
</style>
2841

2942
<div class="row image-header">
30-
<figure class="col-md-12">
31-
<img class="img-fluid rounded mx-auto d-block my-3" src="@ImagePath" width="500" height="auto" alt="@Description"/>
32-
<figcaption>@ImageDescription</figcaption>
43+
<figure class="text-center">
44+
<img src="@ImagePath" class="img-fluid rounded" alt="@Description">
45+
<figcaption class="figure-caption">
46+
<strong>Figure @(Number > 0 ? Number.ToString() : string.Empty) :</strong> @Description
47+
</figcaption>
3348
</figure>
3449
</div>

0 commit comments

Comments
 (0)