Your DockLayoutPanel will need an explicit size somewhere (either by
specifying width or by using top, left, right, bottom with
positioning).

I created a couple of quick examples for you:
http://www.lemonrage.com/nate/misc/centerViaMargins.html
http://www.lemonrage.com/nate/misc/centerFailNoWidth.html

If you take the width off, it expands to fill all of the space, which
I suspect is what's happening to your DockLayoutPanel.

On Aug 5, 8:13 pm, Jose Luis Estrella Campaña <[email protected]>
wrote:
> Hello there !
>
> I'll keep this Question as simple as I can, just for today... I'm
> using UiBinders, and I've got this Widget which I want to be centered,
> so I'm using the margin selector, but I does not work.
>
> Here's my code Snippet:
>
> <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent";>
> <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
>         xmlns:g="urn:import:com.google.gwt.user.client.ui"
>         xmlns:groups="urn:import:org.jose.web.client.widget">
>         <ui:style>
>                 .all-content{
>                                 margin:         auto;
>                 }
>         </ui:style>
>
>         <g:DockLayoutPanel styleName="{style.all-content}" unit="PX">
>
>                 <g:north size="100">
>                                 <groups:HeaderContainerWidget />
>                 </g:north>
>                 <g:center>
>                         <groups:ContentContainer ui:field="content" />
>                 </g:center>
>
>         </g:DockLayoutPanel>
>
> </ui:UiBinder>
>
> I wanted to have it all centered as the result of using the 'all-
> content' selector, But it doesn't work. Could someone please advice me
> on what I am doing wrong ?
>
> Thank you very much !
>
> Sincerely,
>
> Jose.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to