Home › Forums › JavaScript › appending stylesheet on window resize › Reply To: appending stylesheet on window resize
July 23, 2014 at 6:39 pm
#176268
noahgelman
Participant
Well… if you really CAN’T use media queries, then I wouldn’t go the route you’re trying to go.
The biggest problem after attaching a styling sheet, is removing it when sized back up.
What I would do instead which is much easier is on window resize change a class on the html or body tag. For example: sm, med, lrg, xl.
That way, you can have ALL your css on the same style sheet and target different sizes
div {
background:blue;
}
html.sm div {
background:red;
}