I would like to use media queries to resize elements based on the size of a
No, media queries aren't designed to work based on elements in a page. They are designed to work based on devices or media types (hence why they are called media queries).
height, and other dimension-based media features all refer to the dimensions of either the viewport or the device's screen in screen-based media. They cannot be used to refer to a certain element on a page.
If you need to apply styles depending on the size of a certain
div element instead of media queries.