Re: Centering layer
From: Murray (forums_at_HAHAgreat-web-sights.com)
Date: 01/27/05
- Next message: Andre Volk: "Re: Frontpage 2000 synchronization"
- Previous message: Murray: "Re: The new-age gadgets make us look old"
- In reply to: Bill Schroyer: "Re: Centering layer"
- Next in thread: Workinghard: "Re: Centering layer"
- Reply: Workinghard: "Re: Centering layer"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 26 Jan 2005 22:44:04 -0500
Nope. Doesn't work at all. Can't work, since absolute positioning removes
the element from the flow of code on the page.
-- Murray "Bill Schroyer" <bill@frontpagewiz.com> wrote in message news:u6RVoMABFHA.3700@tk2msftngp13.phx.gbl... > LOL - I guess this doesn't work then??? > > <html> > > <head> > <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> > <title>New Page 1</title> > </head> > > <body> > <div align="center"> > <div style="position: absolute; width: 100px; height: 100px; z-index: 1; > background-color: #008080" id="layer1"> > </div> > </div> > </body> > > </html> > > > "Murray" <forums@HAHAgreat-web-sights.com> wrote in message > news:Oasr4l$AFHA.3644@TK2MSFTNGP15.phx.gbl... >> Shame, shame, shame. That'll do nothing other than add code to your >> page. >> And you didn't even terminate the tag, so it's not only wrong, it's > invalid! >> 8) >> >> You *can* center a layer (i.e., an absolutely positioned div), but you > have >> to use CSS to do it. HTML will not have that capability. >> >> Here is a good demonstration - >> >> > http://www.roast-horse.com/tutorials/_tutorials/css_centered_content/index.html >> >> And here is some code - >> >> (inline styles used for clarity) >> >> STYLE*** - >> body { text-align:center; } /* for IE5/IE5.5 */ >> #wrapper { text-align:left; } >> >> BODY - >> <div id="wrapper" style="width:760px; top:0; margin:0 auto; >> position:relative;"> >> <div id="layer1" style="width:200px; top: 25px; left:140px; >> position:absolute;">blah</div> >> <div id="layer2" style="width:180px; top: 136px; left:23px; >> position:absolute;">blah</div> >> </div> >> >> Try that - an outer relatively positioned division with a width and auto >> left and right margins. All interior AP divisions will be centered, yet >> retain the >> same relative positioning. >> >> -- >> Murray >> >> "Bill Schroyer" <bill@frontpagewiz.com> wrote in message >> news:%23jNuXO$AFHA.3592@TK2MSFTNGP09.phx.gbl... >> > Put this above the layer you want to center; >> > >> > <div align="center"> >> > >> > ~Bill Schroyer >> > bill@frontpagewiz.com >> > http://www.frontpagewiz.com >> > >> > >> > "Workinghard" <Workinghard@discussions.microsoft.com> wrote in message >> > news:E10F3819-D5A8-4581-8348-3378A31A58FE@microsoft.com... >> >> Is it posible to have a layer center across the page. >> >> >> >> Currently, the main layer always aligns to the left side of the >> >> browser >> >> window. >> >> I would like the layer to be centered in the browser window. Is this >> >> possible? If so, How do I do It. >> > >> > >> >> > >
- Next message: Andre Volk: "Re: Frontpage 2000 synchronization"
- Previous message: Murray: "Re: The new-age gadgets make us look old"
- In reply to: Bill Schroyer: "Re: Centering layer"
- Next in thread: Workinghard: "Re: Centering layer"
- Reply: Workinghard: "Re: Centering layer"
- Messages sorted by: [ date ] [ thread ]