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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:08:45+00:00 2026-06-11T18:08:45+00:00

Firstly my CSS skills are… a work in progress. But I have got so

  • 0

Firstly my CSS skills are… a work in progress. But I have got so far in as to successfully have a bunch of list items arranged in a grid. http://jsfiddle.net/ashanova/Y4SR3/2/

What I’d like to do now is centre the list items. I have tried to replace float with inline but it causes the width and height of each item to collapse. I would also like to centre the text horizontally and vertically within each list item as well, ideally ellipsisizing (not a word) overflow text. As one last specification I would like to only modify CSS to the ul and its children if thats possible.

  • 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-11T18:08:46+00:00Added an answer on June 11, 2026 at 6:08 pm

    While the language gets a little unclear when you’re dealing with multiple parent and child elements, and centering (/middling) on 2 axes, I think that if the other answers aren’t what you’re looking for, you might actually want display: table-cell.

    Check this fiddle.

    If you give your li elements display: table-cell, text-align: center and vertical-align: middle, I think the text will arrange itself appropriately. Unfortunately, table-cell elements don’t accept margin, so I added a 10px border instead.

    In order to accomplish truncation of text that overflows and the insertion of an ellipse, you’ll need to use some kind of javascript.

    UPDATE

    Having learned more about what you’re after through the many other answers and comments, I’ve come up with a better solution here: http://jsfiddle.net/crowjonah/jx8sD/

    What you need to do is insert <a class="list-item"> tags inside the li elements, and use this CSS:

    .tile li {
        background-color: white;
        display: block;
        float: left;
        margin: 10px;
        overflow: hidden;
    }
    .tile li a.list-item{
        display: table-cell;
        vertical-align: middle;
        height: 75px;
        text-align: center;
        width:75px;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Firstly sorry if this is a common question but I couldn't find anything on
Firstly, this is going to sound like homework, but it ain't. Just a problem
I have a dynamically generated CSS file. It's fairly large, and has different content
I'm halfway to getting this correct, but i am currently stuck. Firstly i would
I'm having some difficulty with a CSS only menu in Ie7. So far the
Firstly, I know that CSS expressions are defunct and wrong in so many ways,
I have been searching to a resolution to this for hours, but I still
Firstly, I would like to say that I have tested if my link to
Firstly, i have a grdData at my main page. After choosing the data i
Firstly, there have some tag links in my main page. click each one, post

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.