In a div
element, the size, which encompasses both width and height, is determined by its content. Since the content is loaded dynamically, there are instances where the width of the div
is greater than its height, and vice versa.
Is it feasible to assign different backgrounds in CSS based on whether the width > height
or width < height
, without using JavaScript?
I am thinking along the lines of an orientation
media query, but specific to a particular element rather than the entire screen.