css - Div vertical-align in a gwt-page -


i trying set div element on right top of web-page contains span, label , button. want bring elements in alignment regarding vertical high (preferably @ middle of div element). vertical-align: middle not work elements cling top of div. influenced external div or panel (since use gwt). should interfere in default attributes of gwt widgets? other solution can suggest? code:

<div class="{style.toprightdisplay}">                 <span style="float:left;">eingeloggt als: </span>                 <g:html ui:field="loginhtml" addstylenames="{style.loginhtml}"></g:html>                 <g:button ui:field="logoutbutton" addstylenames="{style.button}">logout</g:button>             </div>   .button {         float: right;         margin-right: 15px;     }     .loginhtml {         float: left;     }      .toprightdisplay {         float: right;         height: 20px;         width: 200px;         vertical-align: middle;     } 

you misunderstand purpose of vertical-align. see explanation of vertical-align on mdn

you need apply vertical-align child elements, not parent. without knowing markup looks like, suggest this:

.toprightdisplay input, .toprightdisplay button,  .toprightdisplay span{    vertical-align: middle;    display: inline-block; } 

you should remove floats. floats make item render block-level element, means vertical-align won't work.

instead can use display: inline-block. may need change order of elements in hmtl result want.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -