Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

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!

Problem with margin-left:auto / margin-right:auto with Internet Explorer

LanceJJul 25 2008 — edited Jul 25 2008
Hi

I have a problem specifically with alignment of elements on a page with IE (latest). All works well in Firefox or Mac Safari but when I view in IE, the alignment, in particular where I use margin-left:auto / margin-right:auto (either in combination to center or to justify left / right) does not work.

So as a basic example:
<h:panelGrid>
  <h:panelGrid>
    <%-- some table elements --%>
  </h:panelGrid>
  <%-- Button needs to be right-justified; this approach works nicely on all except IE --%>
  <h:panelGrid style="margin-left:auto;">
    <h:commandButton value="Press Me"/>
  </h:panelGrid>
</h:panelGrid>
Help much appreciated
Lance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 22 2008
Added on Jul 25 2008
5 comments
203 views