PDA

View Full Version : Center AP div in dreamweaver CS3


Agent007
05-09-2007, 01:34 AM
I have the new CS3 and I've inserted an "AP Div" (which appears to have taken the place of the "layer"). I've specified left and right margins on auto to center the div, but no dice. My code for that AP div is below.

#apDiv1 {
position:absolute;
left: auto;
right: auto;
width:700px;
height:116px;
z-index:1;
top: 9px;
}

chriskq
05-09-2007, 02:39 AM
is this apDiv sitting inside a parent Div that is positioned: relative;
that is the rule of positioning

what do u mean i have the new CS3?
Like u have the new version of photoshop? ... whats it got to css

Agent007
05-09-2007, 03:31 AM
Chris - I tried making the AP div relative to the div, but it didnt do anything. By CS3 I meant I have the latest version of Dreamweaver V 9.0 also called Dreamweaver CS3 since it was released as part of Adobe Creative Suite 3.

chriskq
05-09-2007, 05:13 AM
sorry not up to times with the suites
i use homesite 5.0 for editing.

lets take a step back.
what are u trying to achieve with the div you want to position on a page

Agent007
05-09-2007, 02:24 PM
I have a top bar that repeats infinitely left and right. I want to put my heading image on top of that bar, centered, so when the browser window is resized, the top bar is always the full width of the window and the heading is always centered. Go to www.pixelotto.com and see the top purple bar? I have a bar just like that. See how all his stuff stays centered when the windows is resized? That's what I'm going for. Thanks Chris.

Andromeda
05-10-2007, 09:08 PM
#apDiv1 {
position:absolute;
left: auto;
right: auto;
width:700px;
height:116px;
z-index:1;
top: 9px;
}

I wonder if you should have the word "margin" in your code. e.g. margin-left:auto;

edbr
05-11-2007, 02:29 AM
absolute gives an exact position, if you have auto then the position would be relative I think. text align -center would give the effect in your example. Post your whole code and we can see better

5h4k42u1u
05-11-2007, 06:24 PM
i'm thinking that you'd probably want the style to be this instead;

#apDiv1 {
position:relative;
margin: auto;
width:700px;
height:116px;
z-index:1;
}

by putting position to absolute, you're telling that you want the browser to put the layer at a very specific coordinate, so the layer would not be able to readjust itself depending on the browser size.