Is there a way to use media queries to change the value of a CSS property gradually as the screen changes size (continuously/smoothly). Instead of setting a bunch of break points at which there is a change (step-ly)?
Like on this site: http://www.bluegoji.com/?
The margins of the <a>
tags in the <ul>
at the top of the page (navbar) decrease continuously as you narrow the browser window.
That is the behavior I am trying to achieve.
Or is the solution just to use so many media queries that it appears to change smoothly??
The example you gave uses flexbox like this:
What you are looking for is not media queries. You can set widths, margins and padding in percentages. That is the normal way of doing this.
Here is an example:
HTML
CSS
Using lots of media queries is one method. But it may not be the best method.
Consider using viewport percentage units.
From the spec:
DEMO