HighDots Forums  

How to center a layer

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss How to center a layer in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
GregSW18
 
Posts: n/a

Default How to center a layer - 06-05-2004 , 08:59 AM






I want to center a layer - so that it's in the middle of the screen no matter
what screen setting.

I've tried in CSS - but can't find the right option.

Or is there an easier way?

Thanks,

- Greg


Reply With Quote
  #2  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: How to center a layer - 06-05-2004 , 09:25 AM






For centering layers, here is a good tutorial

http://www.roast-horse.com/tutorials/_tutorials/css_centered_content/index.html

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


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

"GregSW18" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
I want to center a layer - so that it's in the middle of the screen no
matter
what screen setting.

I've tried in CSS - but can't find the right option.

Or is there an easier way?

Thanks,

- Greg




Reply With Quote
  #3  
Old   
GregSW18
 
Posts: n/a

Default Re: How to center a layer - 06-05-2004 , 10:50 AM



Thanks Murray. But I can't seem to understand their tutorial. They show it done
- but don't explain HOW to do it.

COuld you gave me a couple of quick tips on centering - then setting the layer
X points to the left or right of centre?

Thanks,

- Greg


Reply With Quote
  #4  
Old   
Thierry Koblentz
 
Posts: n/a

Default Re: How to center a layer - 06-05-2004 , 11:47 AM



I thought that what Murray just did

Thierry

GregSW18 wrote:
Quote:
COuld you gave me a couple of quick tips on centering - then setting
the layer X points to the left or right of centre?
Thanks,

- Greg



Reply With Quote
  #5  
Old   
br
 
Posts: n/a

Default Re: How to center a layer - 06-05-2004 , 12:06 PM



you try changing the TOP: and LEFT: tags to a percentage instead of a pixel
count? That's always worked for me. Keep in mind the anchor for the layer
is not the center of the layer but its top-left so 50%, 50% will never place
it dead center.


"GregSW18" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Thanks Murray. But I can't seem to understand their tutorial. They show it
done
- but don't explain HOW to do it.

COuld you gave me a couple of quick tips on centering - then setting the
layer
X points to the left or right of centre?

Thanks,

- Greg




Reply With Quote
  #6  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: How to center a layer - 06-05-2004 , 12:15 PM



Wrap the layer in a relatively positioned division with a fixed width, and
auto left and right margins. This will center the wrapping division. Then
position the layer as needed. This will locate the layer with respect to
the 0, 0 coordinates of the wrapping division.

Does that help?

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

"GregSW18" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Thanks Murray. But I can't seem to understand their tutorial. They show it
done
- but don't explain HOW to do it.

COuld you gave me a couple of quick tips on centering - then setting the
layer
X points to the left or right of centre?

Thanks,

- Greg




Reply With Quote
  #7  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: How to center a layer - 06-05-2004 , 12:43 PM



This is bound to fail....

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

"br" <br (AT) home (DOT) com> wrote

Quote:
you try changing the TOP: and LEFT: tags to a percentage instead of a
pixel
count? That's always worked for me. Keep in mind the anchor for the
layer
is not the center of the layer but its top-left so 50%, 50% will never
place
it dead center.


"GregSW18" <webforumsuser (AT) macromedia (DOT) com> wrote in message
news:c9smju$i58$1 (AT) forums (DOT) macromedia.com...
Thanks Murray. But I can't seem to understand their tutorial. They show
it
done
- but don't explain HOW to do it.

COuld you gave me a couple of quick tips on centering - then setting
the
layer
X points to the left or right of centre?

Thanks,

- Greg






Reply With Quote
  #8  
Old   
GregSW18
 
Posts: n/a

Default Re: How to center a layer - 06-06-2004 , 12:55 PM



Thanks Murray.

But what's a 'division'? How do I 'wrap' a layer?

I don't know anything about code. I just click on buttons and type into boxes
in Dreamweaver.

So which buttons do I click - and what numbers do I type in?

Is this all done in CSS? In the 'Positioning' tab? Or in the properties bar?

Thanks,

- Greg


Reply With Quote
  #9  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: How to center a layer - 06-06-2004 , 01:18 PM



Greg:

Quote:
I don't know anything about code. I just click on buttons and type into
boxes
in Dreamweaver.
Then it's time you learn.

A division is the <div> tag and its contents.

You wrap a layer by putting an opening div tag in front of the layer, and a
closing div tag behind it, e.g.,

a layer = <div id="Layer1" style="blahblahblah">I am the layer's
contents</div>

a wrapped layer = <div id="wrapper"><div id="Layer1" style="blahblahblah">I
am the layer's contents</div></div>

It can all be done is Code view. It can all be done through the DW user
interface from Design view.

If you are using DMX2004, you would find the div tag insert icon under the
Layout toolbar tab.

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

"GregSW18" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Thanks Murray.

But what's a 'division'? How do I 'wrap' a layer?

I don't know anything about code. I just click on buttons and type into
boxes
in Dreamweaver.

So which buttons do I click - and what numbers do I type in?

Is this all done in CSS? In the 'Positioning' tab? Or in the properties
bar?

Thanks,

- Greg




Reply With Quote
  #10  
Old   
GregSW18
 
Posts: n/a

Default Re: How to center a layer - 07-18-2004 , 07:55 AM



Hi Murray,

Sorry to bother you again with this issue - but i'd really like to learn how
to do this centered layer or table thing.

What I want to achieve is the centered 'window' as on the Cartier site.

http://www.cartier.com/us/index.html

When you reduce the browser window - the rectangle adjusts to stay centered -
both HORIZONTALLY and VERTICALLY.

Is it done with layers? I hope so - because nested tables are a pain.

Thanks,

- Greg


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.