CSS center item with position:relative; -



CSS center item with position:relative; -

i've got question css gurus out there!

i've got menu appears on hover on absolutely positioned div. of menu items have relatively positioned because absolutely div appear multiple times on page , appear in multiple sizes in 1 instance.

how center multiple items 'position:relative' both vertically , horizontally when won't know the size of parent div?

i know 'position:absolute' trick negative margins situation calls different.

your help hugely appreciated.

edit:

here's code:

.outercase { position : absolute; width : 100%; height : 100%; text-align: center; } .inneritem { width : 38px; height : 38px; display: inline-block; }

i've got center items horizontally getting vertical that's beingness bit elusive. thanks!

alternatively, may utilize css3 flexible box model. it's great way create flexible layouts can applied center content so:

#parent { -webkit-box-align:center; -webkit-box-pack:center; display:-webkit-box; }

css position alignment center relative

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -