PDA

View Full Version : Display inline in IE7 ignores the width of parent div


Corrosive
08-28-2011, 07:16 AM
Morning all

Have a dilemma this a.m.

I have a list of links for a menu and want them to be 'text-align' centered within a parent div. In most browsers it is fine to set the li styles to display inline as, when the menu gets too long, the links 'break' to the next line.

The problem is IE7. The inline list items ignore the width of the parent div and remain on the same line.

I have 'semi-cured' this for the time being using an IE7 stylesheet and floating the items left where they break and fit the div width fine but, of course, this doesn't allow for centring the menu and all list items are aligned to the left.

Any ideas how I can get the display: inline list items to take notice of the parent div width and break to the next line rather than the menu disappearing off into the distance in IE7?

DWcourse
08-28-2011, 11:40 PM
I don't have a clue but would display:inline-block have a different affect?

Corrosive
08-29-2011, 05:51 AM
I don't have a clue but would display:inline-block have a different affect?

No, well not in a positive way anyway.