Not sure why you're putting panels inside of panels, but I've had much better luck with the setHorizontalAlignment() calls rather than the CSS.
I know this isn't the "proper" technique as it puts styling in the code, but it's the only solution I've found to work 100% of the time. On Jan 29, 10:17 pm, Chris <chrish...@gmail.com> wrote: > I am trying to "center" a panel of text in the North DockLayoutPanel. > I get the following to work on firefox but not IE6. On IE, it looks > like the widths are being ignored (or resized) and the position: > absolute causes problems. > > Any suggestions on how I can "center" a panel? > > public class Application implements EntryPoint{ > > public void onModuleLoad(){ > DockLayoutPanel dock = new DockLayoutPanel(Unit.PX); > > Widget w = new HTML("Text To Center Goes Here!<br/><hr/>"); > > LayoutPanel inner = new LayoutPanel(); > inner.add(w); > inner.setWidth("960px"); > inner.addStyleName("centerstyle"); > > dock.addNorth(inner, 50); > > RootLayoutPanel.get().add(dock); > } > > } > > The style is: > .centerstyle{ > margin: 0 auto; > > } > > and in firefox this will center the "inner" panel. > > TIA, > Chris.... -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.