L457
L457

Reputation: 1032

max-width css property stops centered div from working in internet explorer?

I have a navbar div inside a parent which is horizontally centered/resizes to be responsive using the following css:

.navbar-parent-wrapper{
    width: 100%;
    margin:0 auto;
}

.navbar-child-wrapper{
    position: absolute;
    right: 0;
    left: 0;
    margin: auto;
    max-width:1200px;
    padding-top:10px; 
}

however the max-width property seems to stop my navbar from being centered in internet explorer and causes it to float to the left(works on all other browsers). If i change max-width to width, it works, but stops auto re-sizing to be responsive.

Is there a work around for this?

Upvotes: 2

Views: 663

Answers (1)

Júlio Murta
Júlio Murta

Reputation: 545

Try it

.navbar-child-wrapper{
        position: relative;
        margin: 0 auto;
        max-width:1200px;
        padding-top:10px; 
    }

Upvotes: 2

Related Questions