Ah try giving it something like top:50% and a negative top margin of the height of the inner item should probably do it.
On May 7, 1:38 am, Magnus <[email protected]> wrote: > Hi, > > first, my problem is vertical centering, not horizontal centering. > > I found out by drawing a border around both that the label does not > gain the whole height of the outer SimplePanel. It has its own height > and it's located at the top of the panel. > > Magnus > > On May 6, 3:35 pm, matttai <[email protected]> wrote: > > > > > > > > > From what I know a Label and SimplePanel both translate to a div on > > compilation, so what you are trying to achieve is centering a div > > within a div. What I think is happening is by default the inner div > > should take up the whole interior width so centering cannot occur. > > > Try giving the inner div an arbitrary width (say 50%) and auto margin > > eg. > > > width: 50%; > > margin: auto; > > > If you need the width of the label to be more dynamic and fit the text > > in a more dynamic using something that will translate to a table > > (horizontal / vertical panel) should work out better and only need > > margin:auto (although I'm not sure if its the best widget to use but > > it should achieve what you want) > > > On May 6, 9:39 pm, Magnus <[email protected]> wrote: > > > > Hi, > > > > how can I center a Label within a SimplePanel so that it works in IE7? > > > > I tried nearly every combination of: > > > > getStyle().setVerticalAlignment > > > getStyle.setProperty("display","table-cell"); > > > and others > > > > It always does not work in IE7. > > > > Magnus -- 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.
