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.
精彩评论