I have a form structure dependent on browser window width: to simplify question, assume it has three levels (begin from widest case):
- Field label on the left, input field in the centre and field description on the right
- Field label on the left, input field in the centre and field description below input field
- Field label on the top, input field in the middle and field description on the bottom
It's done by something like this:
@media (max-width:1000px) { /* code for 1. */ }
@media (max-width:900px) { /* code for 2. */ }
@media (max-width:800px) { /* code for 3. */ }
What I'm asking for is to get the same functionality for all elements, so when I put a form
into div
which have 1000px
width, CSS will apply to that particular form
same properties which are used to style 1st layout (max-width:1000px
). When this div
will shrink to 800px
the form
should automatically restyle to the 3rd layout even when browse window still has width set to 1000px
.
Is it possible?