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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:08:48+00:00 2026-05-24T23:08:48+00:00

I am having an issue with text not being aligned in the center of

  • 0

I am having an issue with text not being aligned in the center of a DIV.

I have tried:

text-align:center;

and

width:225px; /*width of div*/ 
margin:0px auto;

and it will not center.

Here is the HTML and CSS for the DIV.

HTML

<div id="past">
<h3><a href="/artistphotos/">View Past Messages</a></h3>
</div>

CSS

#past{
    position:absolute;
    left:0;
    top:363px;
    width:225px;
    height:50px;
    background-image:url('../images/members/roundedbox.png');
    z-index:10;
}

I have applied the text-align and margin using inline styles while I was building the page. I have applied it to the div, h3, and a elements and it won’t work in any of them.

What am I missing here? Thanks!

Here is the HTML Code: (excluding the header and footer elements)

<div class="center over_all_under">
</div>
<!--[if !IE]>start intro<![endif]-->
<div class="center">
</div>
<!--[if !IE]>end intro<![endif]-->
<!--[if !IE]>strat main<![endif]-->
<div class="wrap_fullwidth" id="main">
<div class="center">
<br />
<div id="homepage">
    <div id="homepage-main">
        <div id="homepage-main-item" class="full_shadow>{module_adrotator,5622}
        <div id="past">
          <h3><a href="/artistphotos/">View Past Messages</a></h3>
        </div>

This is followed by a lot of code. I could paste it here but because it is hard to read I only included the code above the div.

  • 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-05-24T23:08:50+00:00Added an answer on May 24, 2026 at 11:08 pm

    text-align:center; works fine for me: http://jsfiddle.net/mrchief/bhtZe/

    #past {
        position:relative;
        left:0;
        top:363px;
        width:225px;
        height:50px;
        background-image:url('../images/members/roundedbox.png');
        z-index:10;
        text-align:center;    
    }
    

    Update: After looking at the page, remove position: absolute from #past h3 as that is preventing the href from center aligning (it gets absolutely positioned).

    Also, your div width is small, if you intent to center it on parent background, set #past width to 100%.

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

Sidebar

Related Questions

I'm having an issue in one of my activities with text being cut-off at
I am having an issue where only the text of the first TextView (eventItemTitle)
I am having an issue trying to make a small text-fantasy type game involving
alt text http://www.mattdell.com/hostedfiles/flexchartissue.bmp I am having an issue where the chart labels on my
having a strange issue, must be something I'm just not seeing. I set up
I'm having an issue with duplicates being inserted on refresh. Our team here decided
I am working on an XMPP client and having an issue with messages being
I'm having an issue where a certain content type is not accessible by standard
I am having an issue with the content of a label being automatically inserted
I have read several posts where users were having this same issue. When compiled,

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.