Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

One for the CSS experts - "margin-left: auto" not working

Andrew RFeb 1 2007 — edited Feb 2 2007
Hi,

I'm building a new theme based on a copy of theme 4 (minimal). I would like all of my page content to render in fixed width centralised position.

I've created a second css (wine.css) file containing the following:

body {
margin: 0;
padding: 0;
font: 73% "Trebuchet MS", tahoma, verdana, arial, sans-serif;
line-height: 1.3em;
color: #666;
background: #F0E9DD url(body_bg.gif) repeat-y;
background-position: 50% 0px;
}

#container {
width: 700px;
margin-left: auto;
margin-right: auto;
padding: 5px;
}

I have then referenced this additional css file in the header definition in the page template (one level tabs).

I've also added the following tag to the end of the header definition

[div id="container"]

and added the closing div tag to the end of the footer definition, just before the closing body tag.

When I run the page the background image is displayed correctly, the page content is displayed 700px wide, but the content is not centered ie the margin-left: auto and margin-right: auto tags have no effect.

Any ideas why?

Thanks,

Andrew.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 2 2007
Added on Feb 1 2007
6 comments
549 views