Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8252767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:38:38+00:00 2026-06-08T00:38:38+00:00

I have an ASP.Net Hyperlink with a set height. The text is rendered at

  • 0

I have an ASP.Net Hyperlink with a set height. The text is rendered at the top left of it. How do I vertically center it (-the text)?

(In C# I’d have: label1.TextAlign = ContentAlignment.MiddleCenter; . How is it done in ASP.Net?)

Tried the following but it doesn’t work (neither on FF nor on IE).

<form id="form1" runat="server">
<div>
<asp:HyperLink NavigateUrl="~/WebForm1.aspx" runat="server" CssClass="MyClass" BackColor="White" 
Height="100px" Text="MyText"  Width="200px" ></asp:HyperLink>
</div>
</form>

And:

.MyClass
{
    display: table-cell;
    text-align: center;
    vertical-align: middle;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:38:39+00:00Added an answer on June 8, 2026 at 12:38 am

    Add the following styles to your HyperLink:

    display:table-cell;
    text-align:center;
    vertical-align:middle;
    

    If you are going to reuse that style is better to define a class:

    <asp:HyperLink ... class="myClass" >HyperLink</asp:HyperLink>
    

    and then in your stylesheet:

    .myClass{
        display:table-cell;
        text-align:center;
        vertical-align:middle;
    }
    

    Or add the styles inline:

    <asp:HyperLink ... style="display:table-cell;text-align:center;vertical-align:middle;" >HyperLink</asp:HyperLink>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in a ASP.NET master page: <div id=hyperlinkimage><asp:HyperLink ID=SomeHyperLink runat=Server
I have asp.net TextBox with ontextchanged event this is search text box in my
I have asp.net Menu Item <asp:MenuItem NavigateUrl= Text=Download Value=Download/> . When this item gets
I have following hyperlink in asp.net: <asp:HyperLink ID=a runat=server ImageUrl=1.png NavigateUrl=https://google.com/></asp:HyperLink> I want to
Hi I have a hyperlink in asp.net that I want to dynamically create. I
I am using ASP.NET checkboxlist control. On the page I have a hyperlink. On
I'm expanding further on this question . I currently have an asp.net hyperlink for
I have an ASP.NET application with contains a list of hyperlinks. After each hyperlink,
I have an asp.net repeater control with a series of asp:hyperlink's <asp:HyperLink runat=server ID=name
I use asp.net and c#4. I have a repeater within inside a HyperLink Control.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.