PDA

View Full Version : Making the page center - relative positioning


GreenGorilla
08-12-2009, 06:59 PM
On an older version of Dreamweaver I would create a site using only layers. To center the pages I would make the first layer the background and nest all other layers inside of it. I would make the postioning for the first layer relative and added a margin with "O auto".

Now with the newer Dreamweaver, I am not creating layers but "apDiv" tags and nesting doesn't seem to be happening.

Bottom line- I am creating a website using only layers and I want everything on the page to center up on the screen when posted, no matter what size a viewer's screen resolution.

domedia
08-12-2009, 07:01 PM
apdiv means that the layer is absolutely positioned.
You don't want that, you want center, which is a relative position.
http://www.dreamweaverclub.com/css-center-content.php

GreenGorilla
08-12-2009, 07:03 PM
really appreciate the help!:-D

GreenGorilla
08-12-2009, 07:22 PM
I read the tutorial on centering. I am still unclear about how to make each new layer I add automatically be centered. Do I have to make CSS adjustments to every new layer I draw on the screen when designing the page? The background layer centers, but each layer afterward is absolute positioning. As I had mentioned before, with the old Dreamweaver, it would automatically "nest" the new absolute positioned layers within the relative positioned one. I didn't have to keep resetting the positioning on each new layer. This version CS3, doesn't automatically nest.

What am I missing?

DWcourse
08-12-2009, 07:35 PM
I read the tutorial on centering. I am still unclear about how to make each new layer I add automatically be centered. Do I have to make CSS adjustments to every new layer I draw on the screen when designing the page? The background layer centers, but each layer afterward is absolute positioning. As I had mentioned before, with the old Dreamweaver, it would automatically "nest" the new absolute positioned layers within the relative positioned one. I didn't have to keep resetting the positioning on each new layer. This version CS3, doesn't automatically nest.

What am I missing?

You need to put the AP divs inside a container div and then center the container and position it relatively.

#container {
margin-right: auto;
margin-left: auto;
position: relative;
}

That will force the "child" AP divs to position themselves with respect to the container div.

Here's a video tutorial on CSS positioning: http://dwcourse.com/css-div-positioning

BTW, absolute positioning isn't generally a good idea, you'll run into more problems down the road.

GreenGorilla
08-12-2009, 08:18 PM
How do I create a "container div". Do I draw a regular apDiv and then change the code somehow? If so, where does this code go? I am not a programmer and when I am told to add code I have no idea where it is supposed to go.

How do you create a "child" div? is there a setting for that?

Corrosive
08-13-2009, 05:37 AM
Forget apdivs and 'drawing' your site. Use relative positioning with div tags.

edbr
08-13-2009, 05:46 AM
Forget apdivs and 'drawing' your site. Use relative positioning with div tags.
yes the prob for non coders or beginners, is the app div is default in DW and there is not a relative positioning in the menu.
so unless this can be altered as default (which Ive never looked at) the answer is to insert a appdiv, re name change to relative positioning and lose the z-index.
if that doesnt make you start coding , nothing will! :)

Corrosive
08-13-2009, 06:01 AM
yes the prob for non coders or beginners, is the app div is default in DW and there is not a relative positioning in the menu.
so unless this can be altered as default (which Ive never looked at) the answer is to insert a appdiv, re name change to relative positioning and lose the z-index.
if that doesnt make you start coding , nothing will! :)

Another reason why DW leads new designers 'up the garden path'. :roll:

edbr
08-13-2009, 06:21 AM
i just looked and cant se a way of changing that

flob a lob said bill, shut up said ben!!

Corrosive
08-13-2009, 06:27 AM
Weeeeeeeeeeeeeeed ;)

edbr
08-13-2009, 07:27 AM
ah those 60.s flash backs again! thank god for that

DWcourse
08-13-2009, 12:46 PM
Dreamweaver got rid of the layers crap and layout mode for "drawing' tables with CS4. You wouldn't believe how many people miss it.

Anyway you now have only the insert div option (at point of insertion or wrap around selection) and you are offered the chance to define a style for the new div (class or ID) when you create it.

domedia
08-13-2009, 08:32 PM
Weeeeeeeeeeeeeeed ;)
OT: Are we talking about your company logo again? ;)

Corrosive
08-14-2009, 11:42 AM
OT: Are we talking about your company logo again? ;)

Still OT: We have changed it now you cheeky sod :wink: