Hi Jagjit,
Please apply CSS to anchor tag then you need to set anchor display: block or inline-block and then it will accept the width and height values. Please refer below sample.
Note: For this sample i have used temporary DataTable. For more details refer How to create Temporary Table in ASP.Net using C# and VB.Net.
HTML
<asp:Repeater ID="Rep1" runat="server">
<ItemTemplate>
<div class="col-lg-6 column-td-half">
<div class="card-item blog-card">
<div class="card-image">
<a href="blog-single.html" class="card__img"></a>
<div class="card-badge">
<span class="badge-label">Posted On <%#Eval("DatePosted","{0: MMM dd, yyyy}") %></span>
<%# Eval("PostTitle")%>
</div>
</div>
<div class="card-content">
<h3 class="card__title mt-0">
<a href="blog-single.html" style="height: 150px; display: inline-block; border:1px solid black"><%# Eval("PostContent")%></a>
</h3>
<div class="card-action">
<ul class="card-duration d-flex align-items-center">
<li>Author : <%# Eval("PostAuthor")%></li>
</ul>
</div>
</div>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
Namespace
C#
using System.Data;
VB.Net
Imports System.Data
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[] {
new DataColumn("DatePosted", typeof(DateTime)),
new DataColumn("PostTitle"),
new DataColumn("PostContent"),
new DataColumn("PostAuthor")
});
dt.Rows.Add("15/04/2022", "Learn", "HTML", "John Hammond");
dt.Rows.Add("16/04/2022", "Learn", "CSS", "Mudassar Khan");
dt.Rows.Add("17/04/2022", "Learn", "ASP.Net", "Suzanne Mathews");
dt.Rows.Add("18/04/2022", "Learn", "Bootsrap", "Robert Schidner");
this.Rep1.DataSource = dt;
this.Rep1.DataBind();
}
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Dim dt As DataTable = New DataTable()
dt.Columns.AddRange(New DataColumn() {New DataColumn("DatePosted", GetType(DateTime)), New DataColumn("PostTitle"), New DataColumn("PostContent"), New DataColumn("PostAuthor")})
dt.Rows.Add("15/04/2022", "Learn", "HTML", "John Hammond")
dt.Rows.Add("16/04/2022", "Learn", "CSS", "Mudassar Khan")
dt.Rows.Add("17/04/2022", "Learn", "ASP.Net", "Suzanne Mathews")
dt.Rows.Add("18/04/2022", "Learn", "Bootsrap", "Robert Schidner")
Me.Rep1.DataSource = dt
Me.Rep1.DataBind()
End If
End Sub
Screenshot