I've got a tentative solution, but it's not quite the pure css
approach I was hoping for:

(1) Define GWT's html-face style as:

.html-face
{
    display: table;
    height: 100%;
    margin: auto;
}

(2) Wrap the user's text inside:

    <html>
        <div style=\"display: table-cell; vertical-align: middle;\">
            user-defined-text
        <div>
    <html>

Is there a better/simpler approach that I'm missing?

On Sep 2, 6:27 pm, Jim Douglas <[email protected]> wrote:
> I'm getting hung up on something that seems like it ought to be
> trivial.  I've got a fixed-size GWT Button and I need to render it
> (preferably using just static CSS rules) such that any arbitrary text
> or HTML content a user throws at it is centered both horizontally
> (that part's easy) and vertically (that part is driving me around the
> bend).
>
> In Java, AbstractButton.setVerticalAlignment(CENTER) just happens; you
> don't have to think about it.  But I can't seem to find any way to
> achieve this same effect on a GWT Button.
>
> Horizontal alignment is trivial:  text-align: center.  But I've spent
> a couple of days trying increasingly bizarre strategies 
> (http://www.google.com/search?q=css+vertical+align) trying to achieve vertical
> alignment, with no success to speak of.
>
> Has anyone else struggled with this problem (or solved it)?
>
> Regards,
> Jim.
--~--~---------~--~----~------------~-------~--~----~
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