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 8443601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:10:58+00:00 2026-06-10T09:10:58+00:00

I searched for this, but found no solution. I have an anchor with a

  • 0

I searched for this, but found no solution.
I have an anchor with a text.

The height and width of the anchor are set by JS on DOM load
I need the text inside the anchor centered vertically and horizontally.

Followed many tutorials on centering elements. None of them worked.

Here is my html

<a href="#" class="wpsc_category_grid_item" title="Category1">
    <span>Category1</span>
</a>

And my CSS

.wpsc_category_grid_item {
    background: #000;
    margin:1px;
    float:left;
    text-align: center;
    display:table;
}

.wpsc_category_grid_item span{
    display: table-cell;
    vertical-align: middle;
    width:100%;
    height:100%;
    color:#fff;
    text-align: center;
    font-weight: bold;
    text-decoration: none; 
}

I need these texts, vertically centered as well..

enter image description here

  • 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-10T09:10:59+00:00Added an answer on June 10, 2026 at 9:10 am

    I made a js fiddle with your code. It worked after I added

    width: 100%;
    height:100%;
    

    to .wpsc_category_grid_item

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've searched this forum (and others) but haven't found a solution yet. I have
I have searched for this but nobody have the same issue.. Now I need
I have searched for a general solution to this but only find answers to
I have searched far and wide on this one, but haven't really found a
I have searched and not found a solution so sorry if this has been
This should be a general problem, i've searched but couldn't found any solution yet,
I have searched but i didn't found any solution to my problem. I want
I've searched for similar questions but still have not found a solution as to
I have now searched for hours, but haven't found a solution yet. I hope
Searched a lot about this problem but never found a answer, that solved it.

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.