html - CSS media min-width not applying all styles -
i have following css styles:
@media (min-width: 1280px) { .window-padding { padding-top: 20px; padding-bottom: 20px; padding-left: 30px; padding-right: 30px; } } @media (min-width: 769px) { .window-padding { padding-right: 20px; padding-left: 20px; padding-left: 10px; padding-right: 10px; } } .window-padding { padding-right: 10px; padding-left: 10px; padding-left: 0px; padding-right: 0px; }
however, when open in browser (width > 1280px), padding-top , padding-bottom min-width:1280px applied. padding-left , padding-right style doesn't have @media condition. here applies:
edit: reordered css have lowest size first fixed issue. also, have duplicate padding styles mistake.
first u go default style ( after increase screen rez ) means default > 768 > 1280 ( apply min-width ) if u choose use max-width ( u go default > 1280 > 768 )
for min width
.class { style } @media screen (min-width: 768) { override default } @media screen (min-width: 1280) { override 768 } , on
for max-width
.class { style } @media screen (max-width: 1280) { override default } @media screen (min-width: 768) { override 1280 } , on
Comments
Post a Comment