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

  • SEARCH
  • Home
  • 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 8398769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:07:56+00:00 2026-06-09T21:07:56+00:00

Can you let me know is there any mistakes in the code below? It

  • 0

Can you let me know is there any mistakes in the code below? It neither align the text in center nor in middle(vertical).

<td> <h2 style = "align:center; vertical-align:middle;">TEXT</h2></td>
  • 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-09T21:07:57+00:00Added an answer on June 9, 2026 at 9:07 pm

    To center the element on the page (horizontally AND vertically) you might want to use margins. There are different ways of doing this; this is just one of them. The margins will be half the size of the container element. Example:

    <td style="width:100%; height:100%;"> 
     <h2 style="position:absolute;top: 50%; left: 50%;">TEXT</h2> 
    </td>
    

    NOTE: The vertical-align property works with images, not with text which is why you need to find other solutions to center your text on a page or within an element. One way is this; margins.

    A drawback of this approach is the fact that the center of the element is not taken to center it on the page; it is pushed to the middle from the borders of the element so to speak. This means that with larger elements the top left corner will be in the center of the page instead of the center point of the element. You can fix this by using negative margins given the size of the element. You need to know the size of the element you are centering. Example:

    If the element to be centered (class .centered) is 200px by 100px, the CSS to center it from the center of the element would look like this:

    .centered { 
     position: fixed;  
     top: 50%;  
     left: 50%;  
     margin-top: -50px;  
     margin-left: 100px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone let me know if there is any equivalent for Internet explorer like
Thanks in advance. Can you please let me know if there are any delegate
Hi I want to know is there any technique through which I can control
I would like to know if there are any tools that can help me
Can anyone let me know how can we change the value of kendo combobox
Can anyone let me know how to set a drop down box for UITextField
Can someone let me know what is the difference between this and jQuery(this) ?
Can anyone let me know how can access an element of a list that
Can anyone let me know how to parallelize for loops using Java 5's JParallelLoops.jar
Can anyone let me know how to implement this feature specified at http://vimeo.com/24475654 Specially

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.