You definitely have to apply some sort of multiple media queries. Code is not magic, and CSS requires specific paramaters for those sorts of queries.
You could use JS, but that is not recommended based on your use case.
Here is a CSS solution
@media all and (minmax-width: 0px) and (min-width: 320px), (max-width: 320px)
{ Insert Code };
}'