Hi, Could you try something like :
public void onModuleLoad() { Label bigTitle = new Label("BIG"); bigTitle.setStyleName("big"); Label smallTitle = new Label("small"); smallTitle.setStyleName("small"); HorizontalPanel panel = new HorizontalPanel(); // this style will set vertical-align: bottom *panel.setVerticalAlignment(HasVerticalAlignment.VerticalAlignmentConstant.ALIGN_BOTTOM); * panel.setStyleName("my");//Probably not useful (cause the classe is applied to "table" DOM node instead of "td" DOM node) panel.add(bigTitle); panel.add(smallTitle); RootPanel root = RootPanel.get(); root.add(panel); } Regards, 2009/6/30 hezjing <hezj...@gmail.com> > Hi > > I have a big label and a small label, and I want to "align-bottom" these > labels when added in HorizontalPanel: > > public void onModuleLoad() { > > Label bigTitle = new Label("BIG"); > bigTitle.setStyleName("big"); > > Label smallTitle = new Label("small"); > smallTitle.setStyleName("small"); > > HorizontalPanel panel = new HorizontalPanel(); > // this style will set vertical-align: bottom > panel.setStyleName("my"); > > panel.add(bigTitle); > panel.add(smallTitle); > > RootPanel root = RootPanel.get(); > root.add(panel); > } > > > and here is my CSS: > > .my { > vertical-align: bottom; > background: yellow; > } > > .big { > font-size: 15px; > font-weight: bold; > background: red; > } > > .small { > font-size: xx-small; > background: blue; > } > > > The problem is the smallTitle is always top aligned. > > > The following is what I observed in Firebug, and it seems that both labels > are set to style="vertical-align: top" > > <table class="my" cellspacing="0" cellpadding="0"> > <tbody> > <tr> > <td align="left" style="vertical-align: top;"> > <div class="big">BIG</div> > </td> > <td align="left" style="vertical-align: top;"> > <div class="small">small</div> > </td> > </tr> > </tbody> > </table> > > > It doesn't help if I > panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM). > > How can I align the labels to the bottom of HorizontalPanel? > > > -- > > Hez > > > > -- Damien Picard Open Source BPM : http://code.google.com/p/osbpm --~--~---------~--~----~------------~-------~--~----~ 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-Toolkit@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 -~----------~----~----~----~------~----~------~--~---