I have figure
and inside it a form
, the big problem is that when I resize the browser, the figure resets perfectly, however the form
that is inside goes out of the object. >
The image below shows your normal view, with the browser maximized.
OBS: The figure
displays the photo and form
is the black rectangle
Whenyouresetthebrowser,form
exitsfromthefigure
centeredspace,asshownbelow.
Ineedform
toalwaysbecenteredinthemiddleoffigure
.
HTML
<figureclass="cx-fotos-portugal">
<form>
</form>
<img src="./fotos-portugal/foto-portugal-capitania-do-porto-cascais.jpg">
</figure>
CSS
figure.cx-fotos-portugal img{
width: 100%;
height: 100%;
max-height: 550px;
}
figure.cx-fotos-portugal form{
position: absolute;
width: 35.71428571428571%;
height: 14.28571428571429%;
max-height: 550px;
background-color: #000;
left: 35%;
top: 30%;
}