开发者

How to center the label on the screen?

I'm specifing the size of the windows within the window.open(), but regardless of the size, I would like this label to be exactly on the center of the screen (vertically and horizontally):

<?xml version="1.0" encoding="UTF-8"?>

<window sizemode="maximi开发者_如何学JAVAzed" hidechrome="true" id="weatherWindow" title="Window"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

    <label style="background:#FFFF00; margin: auto auto auto auto; text-align:center;">LOADING...</label>

</window>

The text is centered horizontally only, any idea how to center it vertically either?


See this article for centering something vertically on the screen using CSS.


Without touching CSS, you can put it in a vbox and set pack="center" on the vbox.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜