Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

centering on page

0 views
Skip to first unread message

Joe Iano

unread,
Jan 4, 2002, 3:02:59 PM1/4/02
to
I have a group of div tags that make up an image that is intended to be
centered on the html page, both vertically and horizontally, regardless of
browser window size.

I can do this with tables, but I would like to do it with CSS. Can anyone
point me in the right direction? I've searched this group and some faqs,
with no success so far. Thanks. Joe


Paul Andrews

unread,
Jan 16, 2002, 7:06:23 AM1/16/02
to
I relocate an image upon loading to the bottom-right corner of the screen.

<img id="Footer" SRC="images/powered.gif" style="position: absolute;
behavior: url('behaviours/footer.htc');" WIDTH="160" HEIGHT="35">

The following is stored in behaviours/footer.htc:

<PUBLIC:COMPONENT>
<PUBLIC:ATTACH EVENT="onresize" FOR="window" ONEVENT="Relocate()" />
<PUBLIC:ATTACH EVENT="onload" FOR="window" ONEVENT="Relocate()" />
<SCRIPT LANGUAGE="VBScript">

function Relocate()
Footer.style.top = window.document.body.clientheight - 60
Footer.style.left = window.document.body.clientWidth - 160
end function
</SCRIPT>
</PUBLIC:COMPONENT>

Place all your component divs into one div and set the behaviour to
footer.htc as above.

You can then change the Relocate function to move the div to the centre of
the screen.

Let me know how you do.

Regards, Paul Andrews

"Joe Iano" <ji...@amphioncomx.com> wrote in message
news:OWpsPrVlBHA.2432@tkmsftngp03...

0 new messages