Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
redblue4356 #1
Centering a layer
Can somone tell me how I can center a layer. I tried using align="center" but that didn't work.
redblue4356 Guest
-
activeX axShockwave.loadMovie(Layer, url) ... what is layer for ?
Hi All, I am working with the shockwave activeX controll loading flash movies into my c# applications. ( I am using falsh mx 2004 Pro) The movies... -
Bottom layer spoils its upprt layer
In my bottom layer, I have a gradient fill in gray color. On top of this layer, I have some paragraphs in blue color. I want the bottom layer has no... -
Bottom layer spoils its upper layer
In my bottom layer, I have a gradient fill in gray color. On top of this layer, I have some paragraphs in blue color. I want the bottom layer has no... -
PE2: Selecting and painting a layer having a Hidden Power Tools' layer mask?
I am making a collage using PE2. I have a background layer (solid color) and then each photo is on its own layer with a layer mask used from the... -
on Director : 3D layer + flash (SWF) layer (or with other layer type)
Thankx for all it's works :) Coool -
Jomo #2
Re: Centering a layer
center the body. i.e.. <body style="text-align:center">
Then all elements within the page will be centered.
for more detail...
[url]http://www.simplebits.com/notebook/2004/09/08/centering.html[/url]
[url]http://www.maxdesign.com.au/presentation/center/[/url]
have fun..
Jomo
--
-----------------------------------------
[url]http://www.DynamicDeveloper.co.uk[/url]
-----------------------------------------
"redblue4356" <chaudhuri1@yahoo.com> wrote in message
news:da2rq2$ns1$1@forums.macromedia.com...> Can somone tell me how I can center a layer. I tried using align="center"
> but that didn't work.
Jomo Guest
-
redblue4356 #3
Re: Centering a layer
Even that didn't work. At least not for the layer. But it did make the text in the body go center.
redblue4356 Guest
-
Murray *TMM* #4
Re: Centering a layer
It wouldn't work ever, since layers are not part of the normal flow on the
page.
Try this -
It depends on whether you are using absolute positioning on the page, as to
which method might be best, but in either event, this will work -
Change this -
</head>
to this -
<style type="text/css">
<!--
body { text-align:center; color:#CCC; }
#wrapper { text-align:left; width:720px; margin:0 auto;position:relative; }
-->
</style>
</head>
change this -
<body ...>
to this -
<body ...>
<div id="wrapper">
and this -
</body>
to this -
</div><!-- /wrapper -->
</body>
and see if that helps.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"redblue4356" <chaudhuri1@yahoo.com> wrote in message
news:dadi2g$b4u$1@forums.macromedia.com...> Even that didn't work. At least not for the layer. But it did make the
> text in the body go center.
Murray *TMM* Guest
-
redblue4356 #5
Re: Centering a layer
I actually want the layer to be centered not its contents because I have a background for the layer.
redblue4356 Guest
-
rob::db #6
Re: Centering a layer
Oh really? What if the layers have a relative position set? I think they are
more than somewhat part of the flow then...
> It wouldn't work ever, since layers are not part of the normal flow
> on the page.
rob::db Guest
-
Murray *TMM* #7
Re: Centering a layer
This may help you understand positioning a bit -
There are 4 different types of positioning:
Absolute
Relative
Fixed
Static
Here is a brief explanation of each kind....
Position:absolute
-----------------------
This does several things -
1. It 'removes' the element from the flow of the code on the* page so that
it can no longer influence the size or position of any other pa*ge element
(except for those contained within it, of course).
2. The absolutely positioned element takes its position from the position of
its closest PA*RENT *positioned* element - in the absence of any explicitly
positioned parent, this will
default to the <html> tag, which is always positioned *at 0,0 in the browser
viewport.
This means that it doesn't matter where in the HTML code the laye*r's code
appears (between <body> and </body>), its location on the screen will not
change. Furthe*rmore, the space in which this element would have appeared
were it not positi*oned is
not preserved on the screen. In other words, absolutely positioned elements
don't take up any space on the page. In fact, they FLOAT over the page.
Position:relative
----------------------
In contrast to absolute positioning, a relatively positioned page element is
*not* removed from t*he flow of the code on the page, so it will use the
spot where it would have* appeared
based on its position in the code as its zero point reference. If* you then
supply top, right, bottom, or left positions to the style for this *element,
those values will be used as offsets from its zero point.
This means that it DOES matter where in the code the relativ*ely positioned
element appears, as it will be positioned in that location (*factoring in
the offsets) on the screen. Furthermore, the space where this e*lement
would have appeared is preserved in the display, and can therefore* affect
the
placement of succeeding elements. This means that the taller a relatively
positioned element is, the more space it forces on the page.
Position:static
-------------------
As with relative position, static positions also "go with *the flow". An
element with a static position cannot have values for offset*s (top, right,
left, bottom) or if it has them, they will be ignored. Unless explicitly
positioned, all div elements default to static positioning.
Position:fixed
------------------
A page element with this style will not scroll as the page c*ontent scrolls.
Support for this in elements other than page backgrounds is *quirky
There are two other things you need to know:
1. ANY page element can be positioned - paragraphs, tables, images, lists,
etc.
2. The <div> tag is a BLOCK level tag. This means that if it is not
positioned or explicitly styled otherwise, a) it will always begin on a new
line on the screen, and b) it will always force content to a new line below
it, and c) it will always take up the entire width of its container (i.e.,
width:100%).
You can see a good example of the essential difference between absolute and
relative positioning here -
[url]http://www.great-web-sights.com/g_layersdemo.asp[/url]
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"rob::db" <rob@digitalburn.net> wrote in message
news:dagfl8$mrm$1@forums.macromedia.com...> Oh really? What if the layers have a relative position set? I think they
> are
> more than somewhat part of the flow then...
>>>> It wouldn't work ever, since layers are not part of the normal flow
>> on the page.
>
Murray *TMM* Guest
-
Murray *TMM* #8
Re: Centering a layer
Huh? If the layer is centered its content will be centered as well.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"redblue4356" <chaudhuri1@yahoo.com> wrote in message
news:dagect$l19$1@forums.macromedia.com...>I actually want the layer to be centered not its contents because I have a
>background for the layer.
Murray *TMM* Guest
-
rob::db #9
Re: Centering a layer
I understand positioning very well thanks ;) This says exactly what I said,
which is that relatively positioned layers (or any elements) are in the flow
of the page, which contradicted your statement that layers were (implicitly)
always removed from the flow of the page.
Murray *TMM* wrote:> This may help you understand positioning a bit -
>
> There are 4 different types of positioning:
> Absolute
> Relative
> Fixed
> Static
>
> Here is a brief explanation of each kind....
>
> Position:absolute
> -----------------------
> This does several things -
> 1. It 'removes' the element from the flow of the code on the* page so
> that it can no longer influence the size or position of any other
> pa*ge element (except for those contained within it, of course).
>
> 2. The absolutely positioned element takes its position from the
> position of its closest PA*RENT *positioned* element - in the absence
> of any explicitly positioned parent, this will
> default to the <html> tag, which is always positioned *at 0,0 in the
> browser viewport.
>
> This means that it doesn't matter where in the HTML code the laye*r's
> code appears (between <body> and </body>), its location on the screen
> will not change. Furthe*rmore, the space in which this element would
> have appeared were it not positi*oned is
> not preserved on the screen. In other words, absolutely positioned
> elements don't take up any space on the page. In fact, they FLOAT
> over the page.
>
> Position:relative
> ----------------------
> In contrast to absolute positioning, a relatively positioned page
> element is *not* removed from t*he flow of the code on the page, so
> it will use the spot where it would have* appeared
> based on its position in the code as its zero point reference. If*
> you then supply top, right, bottom, or left positions to the style
> for this *element, those values will be used as offsets from its zero
> point.
>
> This means that it DOES matter where in the code the relativ*ely
> positioned element appears, as it will be positioned in that location
> (*factoring in the offsets) on the screen. Furthermore, the space
> where this e*lement would have appeared is preserved in the display,
> and can therefore* affect the
> placement of succeeding elements. This means that the taller a
> relatively positioned element is, the more space it forces on the
> page.
>
> Position:static
> -------------------
> As with relative position, static positions also "go with *the flow".
> An element with a static position cannot have values for offset*s
> (top, right, left, bottom) or if it has them, they will be ignored.
> Unless explicitly positioned, all div elements default to static
> positioning.
>
> Position:fixed
> ------------------
> A page element with this style will not scroll as the page c*ontent
> scrolls. Support for this in elements other than page backgrounds is
> *quirky
>
> There are two other things you need to know:
>
> 1. ANY page element can be positioned - paragraphs, tables, images,
> lists, etc.
> 2. The <div> tag is a BLOCK level tag. This means that if it is not
> positioned or explicitly styled otherwise, a) it will always begin on
> a new line on the screen, and b) it will always force content to a
> new line below it, and c) it will always take up the entire width of
> its container (i.e., width:100%).
>
> You can see a good example of the essential difference between
> absolute and relative positioning here -
>
> [url]http://www.great-web-sights.com/g_layersdemo.asp[/url]
>
>
> "rob::db" <rob@digitalburn.net> wrote in message
> news:dagfl8$mrm$1@forums.macromedia.com...>> Oh really? What if the layers have a relative position set? I think
>> they are
>> more than somewhat part of the flow then...
>>>>> It wouldn't work ever, since layers are not part of the normal flow
>>> on the page.
rob::db Guest
-
Murray *TMM* #10
Re: Centering a layer
Not at all. A layer (at least in DW parlance) is an absolutely positioned
element. Any absolutely positioned element. As soon as you change its
positioning to relative it is no longer a layer.
I stand by my earlier statement - layers are removed from the normal flow,
therefore they cannot be centered by the code you suggested.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"rob::db" <rob@digitalburn.net> wrote in message
news:dagt52$ed8$1@forums.macromedia.com...>I understand positioning very well thanks ;) This says exactly what I said,
> which is that relatively positioned layers (or any elements) are in the
> flow
> of the page, which contradicted your statement that layers were
> (implicitly)
> always removed from the flow of the page.
>
>
>
Murray *TMM* Guest
-
rob::db #11
Re: Centering a layer
> (at least in DW parlance)
Oh dear. In the real world it just means a div.
rob::db Guest
-
rob::db #12
Re: Centering a layer
> therefore they cannot be centered by the code you suggested.
And besides, I didn't suggest any code. If I did, it would work in the same
way for both absolutely and relatively position elements.
rob::db Guest
-
Murray *TMM* #13
Re: Centering a layer
> Oh dear. In the real world it just means a div.
Actually it does not. There is no such HTML thing as a "layer". Common
usage in DW is that anything absolutely positioned is a layer (try
absolutely positioning an image - you'll see it appear in DW's Layer Panel).
In FP, anything given a z-index is a "layer". I'm not sure how GoLive
treats it, but I suspect it's one of those two nuances.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"rob::db" <rob@digitalburn.net> wrote in message
news:dai6nf$a48$1@forums.macromedia.com...>>> (at least in DW parlance)
> Oh dear. In the real world it just means a div.
>
>
Murray *TMM* Guest
-
redblue4356 #14
Re: Centering a layer
Actually I have a background of the layer which I'm using as the page's
background too. So the code you provided does make the layer centered and even
its contents but when I give a background to it its comes to its original
position. Maybe I need to add a little something to the code but I don't know
what. So maybe you can tell!
redblue4356 Guest
-
Murray *TMM* #15
Re: Centering a layer
Adding a background color to a layer couldn't possibly affect its
positioning. Perhaps you could show me your code, so I can examine it and
see what you are describing?
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"redblue4356" <chaudhuri1@yahoo.com> wrote in message
news:daj882$q8o$1@forums.macromedia.com...> Actually I have a background of the layer which I'm using as the page's
> background too. So the code you provided does make the layer centered and
> even
> its contents but when I give a background to it its comes to its original
> position. Maybe I need to add a little something to the code but I don't
> know
> what. So maybe you can tell!
>
Murray *TMM* Guest
-
redblue4356 #16
Re: Centering a layer
It's not a background color. It's a background image.
redblue4356 Guest
-
Murray *TMM* #17
Re: Centering a layer
Same thing. As with a background color, adding a background image could not
have this effect either.
Without seeing your code, though, it would be impossible to say what is
really happening.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"redblue4356" <chaudhuri1@yahoo.com> wrote in message
news:daje6s$698$1@forums.macromedia.com...> It's not a background color. It's a background image.
Murray *TMM* Guest



Reply With Quote

