html - Margin: 0 auto; not working image -


so have code, trying center image when screen size , below, isn't working. isn't changing position @ all.

screenshot:

#navbar {     margin: 0;     padding: 0;     height: 55px;     width: 100%;     background-color: #3399ff; } #navbar_logo {     margin: 0 0 0 150px;     padding: 0;     float: left; } #navbar_links {     margin: 0 0 0 250px;     padding: 0;     height: 55px;     width: 430px;     float: left; } #navbar_links {     margin: 0 0 0 20px;     padding: 0;     float: left; } @media screen , (max-width: 730px){     #navbar {         height: 110px;     }     #navbar_logo {         display: block;         margin: 0 auto;     }     #navbar_links {         margin: 0 0 0 50px;         width: 430;      } } 

floating element push side if has auto margins.

you need explicitly set float none.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -