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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:30:07+00:00 2026-05-21T16:30:07+00:00

What is the best semantic way to keep horizontal list items center aligned? Is

  • 0

What is the best semantic way to keep horizontal list items center aligned?

Is it possible to keep the items center aligned of this code

 <ul id="items">
  <li>item 1</li>
  <li>item2</li>
  <li>iem3</li>
</ul>

li {list-style:none; font-size:16px; float:left; font-size:14px}

I found this way on search http://css-tricks.com/examples/CenterHorizontalListItems/

is there any other better way? without needing extra div

Is there any trick to write something for this ul li { } to keep list item center aligned?

  • 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-21T16:30:08+00:00Added an answer on May 21, 2026 at 4:30 pm

    All you need is display:inline or display:inline-block applied to the <li>s and text-align:center applied to the <ul> to get the centering. You definitely don’t need extra non-semantic markup.

    http://jsfiddle.net/Madmartigan/rKqMq/2/

    There are other ways that involve float but IMO this way is best. Note that those two display properties behave differently, so you’ll have to tune to meet your needs.

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

Sidebar

Related Questions

Is Microformats still a best semantic way to code contact information in a web
What's the best way to do the semantic equivalent of the traditional sleep() system
Best to describe this in code... I have this public class A<T> { public
Best explained with code I think, this is just a simple example: public class
What is the best way to construct an #ask query using semantic properties from
What is the best method to code physical address in html ? in Semantic,
What's the best way to create multiple backgrounds with HTML5 and CSS and keep
Possible Duplicate: Nullable values in C++ What is the best way to represent nullable
This question is more a semantic-algorithmic-data-structure question than a F# syntactically question. I have
What is the best way to obtain a simple, efficient immutable queue data type

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.