change this - to this -
and this - to this -
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" wrote in message news:dadi2g$b4u$1@forums.macromedia.com...[quote] > Even that didn't work. At least not for the layer. But it did make the > text in the body go center.[/quote] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Murray *TMM* [ip] => forums@HAHAgrea [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 4 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> Centering a layer - Macromedia Dynamic HTML

Centering a layer - Macromedia Dynamic HTML

Can somone tell me how I can center a layer. I tried using align="center" but that didn't work....

Sponsored Links
  1. #1

    Default Centering a layer

    Can somone tell me how I can center a layer. I tried using align="center" but that didn't work.
    Sponsored Links
    redblue4356 Guest

  2. #2

    Default 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> wrote in message
    news:da2rq2$ns1$1forums.macromedia.com...
    > Can somone tell me how I can center a layer. I tried using align="center"
    > but that didn't work.

    Jomo Guest

  3. #3

    Default 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

  4. #4

    Default 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> wrote in message
    news:dadi2g$b4u$1forums.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

  5. #5

    Default 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

  6. #6

    Default 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

  7. #7

    Default 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 page element
    (except for those contained within it, of course).

    2. The absolutely positioned element takes its position from the position of
    its closest PARENT *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 layer's code
    appears (between <body> and </body>), its location on the screen will not
    change. Furthermore, the space in which this element would have appeared
    were it not positioned 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 the 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 relatively positioned
    element appears, as it will be positioned in that location (factoring in
    the offsets) on the screen. Furthermore, the space where this element
    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 offsets (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 content 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" <robdigitalburn.net> wrote in message
    news:dagfl8$mrm$1forums.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

  8. #8

    Default 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> wrote in message
    news:dagect$l19$1forums.macromedia.com...
    >I actually want the layer to be centered not its contents because I have a
    >background for the layer.

    Murray *TMM* Guest

  9. #9

    Default 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
    > page element (except for those contained within it, of course).
    >
    > 2. The absolutely positioned element takes its position from the
    > position of its closest PARENT *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 layer's
    > code appears (between <body> and </body>), its location on the screen
    > will not change. Furthermore, the space in which this element would
    > have appeared were it not positioned 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 the 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 relatively
    > positioned element appears, as it will be positioned in that location
    > (factoring in the offsets) on the screen. Furthermore, the space
    > where this element 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 offsets
    > (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 content
    > 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" <robdigitalburn.net> wrote in message
    > news:dagfl8$mrm$1forums.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

  10. #10

    Default 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" <robdigitalburn.net> wrote in message
    news:dagt52$ed8$1forums.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

  11. #11

    Default Re: Centering a layer

    > (at least in DW parlance)

    Oh dear. In the real world it just means a div.


    rob::db Guest

  12. #12

    Default 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

  13. #13

    Default 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" <robdigitalburn.net> wrote in message
    news:dai6nf$a48$1forums.macromedia.com...
    >> (at least in DW parlance)
    >
    > Oh dear. In the real world it just means a div.
    >
    >

    Murray *TMM* Guest

  14. #14

    Default 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

  15. #15

    Default 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> wrote in message
    news:daj882$q8o$1forums.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

  16. #16

    Default Re: Centering a layer

    It's not a background color. It's a background image.
    redblue4356 Guest

  17. #17

    Default 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> wrote in message
    news:daje6s$698$1forums.macromedia.com...
    > It's not a background color. It's a background image.

    Murray *TMM* Guest

Similar Threads

  1. Replies: 2
    Last Post: March 24th, 04:47 AM
  2. Bottom layer spoils its upprt layer
    By jae kim in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 6
    Last Post: August 14th, 01:46 AM
  3. Bottom layer spoils its upper layer
    By jae kim in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 2
    Last Post: August 13th, 06:15 AM
  4. PE2: Selecting and painting a layer having a Hidden Power Tools' layer mask?
    By Richard Hirschman in forum Adobe Photoshop Elements
    Replies: 6
    Last Post: August 7th, 03:05 PM
  5. on Director : 3D layer + flash (SWF) layer (or with other layer type)
    By onelsonic webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 1
    Last Post: July 16th, 01:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •