GUIs - A Modest Proposal

AD. anton.list at gmail.com
Mon Jun 14 21:02:15 EDT 2010


On Jun 15, 12:06 pm, Stephen Hansen <me+list/pyt... at ixokai.io> wrote:
> "Arbitrarily sized" was the key point ;-) In that, you set the sizes of
> the div's explicitly.

As I said to Ed, I think you missed why I included the exact same
image in two divs of different sizes. That was to show it was still
centered no matter what size the container was. It is even easier to
fit it to the browser window.

> I wasn't clear in my rhetorical question; the size
> is arbitrary because you have no control over it.       You can do horizontal
> center easy; just set margin-left and margin-right to auto (and be sure
> to set display: block if you're not sure which mode you'll end up).
> Vertical centering outside of a table cell is a right pain in the ass.  
>
> Like so: Create an HTML single image that sits dead in the center of
> your screen when your browser is maximized. Then if you adjust your
> browser to be half as wide, its still in the center. Just the new center.

Even easier than the first example:

(Yeah I know these are trivial and quickly get out of hand on a real
UI)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-
strict.dtd">
<html>
<head>
<style>

img {
    position: absolute;
    width:100px;
    height: 100px;
    margin: auto;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border: 1px solid red;
    }

</style>
</head>
<body>

<img src="image1.jpg" />

</body>
</html>

Anyway, wasn't this supposed to be about Python :)

--
Cheers
Anton



More information about the Python-list mailing list