-2
I’m trying to make a pop-up with a login screen, however the div
of class="form-login-div"
is not being automatically centralized at all.
Any idea? CSS:
.form-login-div-parent{
width: 100vw;
position: relative;
bottom:0;
}
.form-login-div {
width: 35rem;
height:auto;
position:absolute;
z-index:1;
border-radius:0.5rem;
padding:1rem;
background-color:#0374D6;
}
.home-container{
width:30rem;
z-index: 1;
position: relative;
border-radius: 5px;
}
HTML:
<div class="home-container">
<div class="form-login-div-parent">
<div class="form-login-div">
<form action="" method="post">
<div class="form-group">
<label>Endereço de e-mail</label>
<input type="email" class="form-control" name="email" placeholder="Insira o seu e-mail">
</div>
<div class="form-group">
<label>Senha</label>
<input type="password" class="form-control" name="senha" placeholder="Insira a sua senha">
</div>
<div>
<div style="text-align: left;">
{% if view_bag["erro"] == true %}
<p style="color: rgb(240, 47, 47); ">{{ view_bag["mensagem"] }}</p>
{% endif %}
</div>
<div style="text-align: right;">
<button type="submit">Entrar</button>
</div>
</div>
</form>
</div>
</div>
<picture>
<source class="imagem-fundo" media="(max-width: 1140px )" srcset="/static/img/imagemestudante-smartphones-blur.png"
type="image/png">
<img class="imagem-fundo" src="/static/img/imagemestudante-full.jpg" alt="Foto de estudantes ao fundo">
</picture>
</div>
related https://answall.com/questions/58614/centralizar-horizontally. and https://answall.com/questions/33495/como-centralizar-uma-div-com-positionfixed gives a search on the site has many questions about it
– Ricardo Pontual
I researched the "similar questions" but did not find
– João Henrique