Jump to content

Center a li or div with an unspecified width


TheFilmGod

Recommended Posts

How can I center an li or div without a specified width?

 

I can do display: inline-block; or display: table; FF2 doesn't support inline-block; so I don't mind using display: table. IE7 doesn't support either. Is there a way to simulate the display: table; effect in IE7 without adding extra markup?

Link to comment
Share on other sites

display: table; or display: inline-block; are viable solutions for FF users.

 

IE doesn't support table. It will not display divs, li, or other block level elements with display: inline-block. Only elemnts that were initially inline, can inherit the inline-block property.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.