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.
#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
Post a Comment