Title: center a panel in a layout region Post by: chrwei on August 15, 2013, 02:03:05 PM I'm trying to get a panel centered inside a layout. this was first try:
Code: <div data-options="region:'center'"> using Chrome's inspector I see this gets parsed out to: Code: <div class="panel" style="display: block; width: 400px;"> putting the style on the panel-body and not copying it to the panel where it will actually do something. I also tried these: Code: data-options="style:{margin: 0 auto}" this one does not error, and puts the margin in the panel where it should be Code: data-options="style:{margin: 0}" before I attempt fixing the style parser, should I be doing this a different way? Title: Re: center a panel in a layout region Post by: stworthy on August 15, 2013, 07:02:15 PM Try this code:
Code: <div data-options="region:'center'"> Title: Re: center a panel in a layout region Post by: chrwei on August 16, 2013, 05:50:35 AM there's the trick! thanks.
so for something like margin-top:0px I'd do style:{'margin-top':0} ? Title: Re: center a panel in a layout region Post by: stworthy on August 16, 2013, 07:02:27 AM Code: data-options="style:{margeTop:0}" Title: Re: center a panel in a layout region Post by: chrwei on August 16, 2013, 07:35:19 AM so style:{} doens't take css properties, it takes the javascript equivalent?
|