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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:36:42+00:00 2026-06-07T14:36:42+00:00

This has been asked before by other people, but I’ve never seen an adequate

  • 0

This has been asked before by other people, but I’ve never seen an adequate answer. Is there a valid replacement to the <center> tag?

I know there’s margin: 0 auto;, but that requires setting a width. There’s also align="center", but I believe that that’s invalid code as well.

Is there something as simple as <center> that’s valid? There are rare occasions where I still end up using it, even though it is deprecated. Just today, I ended up using a <center> to center the one button that needed centered on a web page. Yes, I could have set the width and gave it margin: 0 auto, but that’s a lot of work for centering one single element, and it dirties up my code, which I take pride in keeping orderly. I don’t really understand why <center> was deprecated in the first place, if nothing has replaced it.

Thanks!

  • 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-07T14:36:44+00:00Added an answer on June 7, 2026 at 2:36 pm

    text-align: center is what you should use. In fact, the ideal way is this:

    .center {
        text-align: center;
    }
    .center > div, .center > table /* insert any other block-level elements here */ {
        margin-left: auto;
        margin-right: auto;
    }
    

    Obviously, it’s not quite as simple as you might hope for.

    Personally, I just use:

    .center {text-align: center;}
    .tmid {margin: 0px auto;}
    

    Then apply classes where needed.

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

Sidebar

Related Questions

This question has been asked before but 1) the user never accepted an answer
This has been asked before, but the other poster's concern had more to do
I know this has been asked before , but at this time the answer
I know this question has been asked before but the other solutions didn't work
I'm sure some variation of this question has been asked before but all other,
Apologies if this has been asked before but is there any way, at all,
I know this has been asked before, but I checked the other threads and
I know it seems this has been asked before, but I need a batch
Sorry if this has been asked before, but I couldn't find a good example
Forgive me if this has been asked before, but I assure you I've scoured

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.