-2
Good morning, I’m creating a responsive web page and I’d like the top of the card to always be right in the middle of the image I put in the background, regardless of the screen size. I have no idea how to do this. Please help me.
* {
margin: 0;
padding:0;
}
html, body {
overflow: hidden;
width: 100%;
height: 100%;
}
.fundo1{
display: table;
width: 100%;
height: 35%;
padding: 100px 0;
color: white;
background: url('https://images.unsplash.com/photo-1526374965328-7f61d4dc18c5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1050&q=80') no-repeat bottom center scroll;
background-position: 30% 45%;
background-size: cover;
filter: blur(6px);
position: absolute;
}
.meucard{
margin-top: 15%;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Pagina web</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
</head>
<body>
<div class="fundo1">
</div>
<div class="container meucard">
<div class="card text-center">
<div class="card-body">
<h5 class="card-title">Principal</h5>
<p class="card-text">Contato</p>
<a href="#" class="btn btn-primary">Teste</a>
</div>
</div>
</div>
</body>
</html>