You need to switch your values:
/* No less than 400px, no greater than 900px */
@media (min-width:400px) and (max-width:900px) {
.foo {
display:none;
}
}
Demo: http://jsfiddle.net/xf6gA/ (using background color, so it’s easier to confirm)