I understand similar questions have been asked multiple time, I’ve tried their solutions tailored to my code but none of them seem to work. My website has a header with a div inside of it containing a WordPress Contact Form 7 form. The whole site is responsive, other than the Contact form div which stays it’s height (not fixed) and doesn’t decrease in height – only width. Below is the code. #imgDiv
is the parent and #property-search
is the child div. #property-search
is the div that only decreases in width and not height.
#imgDiv { position: relative; width: 100%; overflow: auto;}
#imgDiv img { width: 100%; }
#property-search { position: absolute;top: 0; margin-left: 450px; min-width: 18%; background-color: rgba(23, 81, 61, 0.5); overflow: auto; margin-right: 450px;}
EDIT: I understand that positioning absolute will result in the child div not changing in height relative to it’s parent. Hence, I’m looking for a way round this, rather than to be educated on the use of absolute and relative position. Thanks!
Not sure what the need for the absolute positioning is for but if it only to put your text on top of your image, why not just make your image a background-image?