html - centre horizontally within parent -


on this page show list of artists appearing @ festival. placement of artist <div>s controlled isotope (it difficult lineup using css alone when there large number of artists , artist divs different heights).

anyway, centre artist divs within parent container there's equal amount of white space left , right of artists, illustrated below.

enter image description here

i've tried obvious things like:

margin: 0 auto text-align: center 

but no luck far....

the parent must have

text-align:center; width:abc; 

and width. child should have

margin:auto; text-align:left; width:xyz; 

example:

<div style="width:100%; text-align:center;">     <div style="width:50%; text-align:left; background:red; margin:auto;">         right     </div> </div> 

if not work, should check if else influences behavior!


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -