# Div not centering in Firefox, but fine in IE

**URL:** <https://forum.kirupa.com/t/div-not-centering-in-firefox-but-fine-in-ie/293782>\
**Category:** web dev\
**Created:** [August 3, 2009, 8:06pm UTC](https://forum.kirupa.com/t/div-not-centering-in-firefox-but-fine-in-ie/293782 "2009-08-03T20:06:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpearson311](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jpearson311](https://forum.kirupa.com/u/jpearson311)\
**Post date:** [August 3, 2009, 8:06pm UTC](https://forum.kirupa.com/t/div-not-centering-in-firefox-but-fine-in-ie/293782/1 "2009-08-03T20:06:16Z")

</div>

Hi all. I have a div that I’m trying to center. It’s working fine in IE, but not in Firefox. I have it positioned because I’m using z-index and when I take the position attribute away, it centers, but I have to have a position in order to use z-index. I must keep z-index. If anyone could help me out, I’d appreciate it. Here is my CSS:

```auto

.nav {position:fixed; width:955px; z-index:1; margin-left:auto; margin-right:auto; text-align:center;}

```
