This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > April 2004 > Centering Layers





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Centering Layers
Flesh

2004-04-05, 10:40 pm

Hi all
Just starting to use layers so be gentle.
How do i get a layer to center in a browser even if its resized? A CSS answer best please. I tried an extension but it did not work in DWMX2004
Murray *TMM*

2004-04-05, 10:40 pm

Flesh:

Which extension? If it's SNAP, it does work in DMX2004.

But here's the CSS -


(inline styles used for clarity)

<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.

Here is a good demonstration -

http://www.roast-horse.com/tutorial...tent/index.html


--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Flesh" <webforumsuser@macromedia.com> wrote in message
news:c4sf80$hte$1@forums.macromedia.com...
> Hi all
> Just starting to use layers so be gentle.
> How do i get a layer to center in a browser even if its resized? A CSS

answer best please. I tried an extension but it did not work in DWMX2004


Alex Billerey

2004-04-05, 10:41 pm

Murray

I was under the impression that min-width was not supported by IE. Do
you know if this is correct or not.

Alex
"Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
news:c4sfcm$i28$1@forums.macromedia.com...
> Flesh:
>
> Which extension? If it's SNAP, it does work in DMX2004.
>
> But here's the CSS -
>
>
> (inline styles used for clarity)
>
> <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.
>
> Here is a good demonstration -
>
>

http://www.roast-horse.com/tutorial...tent/index.html
>
>
> --
> Murray --- ICQ 71997575
> Team Macromedia Volunteer for Dreamweaver MX
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
> news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO

GET
> ANSWERS
> ==================
> http://www.dreamweavermx-templates.com - Template Triage!
> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
> ==================
>
> "Flesh" <webforumsuser@macromedia.com> wrote in message
> news:c4sf80$hte$1@forums.macromedia.com...
CSS[color=darkred]
> answer best please. I tried an extension but it did not work in

DWMX2004
>
>


Murray *TMM*

2004-04-05, 10:41 pm

I have not used min-width. My O'Reilly tells me that it is NOT supported by
IE but is by NN6+.

Quien sabe?

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Alex Billerey" <aabDONTWANTSPAM@clara.net> wrote in message
news:c4snsj$t4j$1@forums.macromedia.com...
> Murray
>
> I was under the impression that min-width was not supported by IE. Do
> you know if this is correct or not.
>
> Alex
> "Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
> news:c4sfcm$i28$1@forums.macromedia.com...
> auto
> yet
>

http://www.roast-horse.com/tutorial...tent/index.html
> GET
> CSS
> DWMX2004
>



Barry Pearson

2004-04-06, 7:29 am

Murray *TMM* wrote:
> I have not used min-width. My O'Reilly tells me that it is NOT
> supported by IE but is by NN6+.


That appears to be the case. IE 6 doesn't support either min-width or
max-width. Firefox does.

If you want valid & reasonably-cross-browser support of the *effects* of
min-width and/or max-width, with CSS control of the relevant widths, I think
you have do have to do things like:

For min-width, use a 1-pixel spacer GIF and:
img {
width: 400px;
height: 0;
}

For max-width, use a single-cell table such as:

<table><tr><td id="widthcontrol">
Content goes here
</td></tr></table>

#widthcontrol {
width: 400px;
}

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews