I’m beginner, I would like to ask how can I make the "blured gray img" always stay in the center like the image. What I want with figma
This is my code and result:This is what created but it doesn’t like before image.Right and bottom sides are stuck to the browser edge.
The CSS:
html,body {
margin: 0px;
height: 100%;
}
.bg img {
position: fixed;
width: 100%;
height: 100%;
background-size: cover;
}
.wrapper {
position: fixed;
width: 100vw;
height: 100vh;
background-color: #38323283;
border-radius: 45px;
box-shadow: 3px 3px 4px #00000040, -3px -3px 4px #00000040;
margin-top: 50px;
margin-bottom: 50px;
margin-left: 50px;
margin-right: 50px;
}
The HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>profile</title>
<link rel="stylesheet" href="CSS/style.css">
</head>
<body>
<div class="bg">
<img src="/img/IMG_0720.png" alt="">
<div class="wrapper">
</div>
</div>
</body>
</html>
2
Answers
Bro use this code
I guess you just missed to code
top
into yourwrapper
.Perhaps you can fiddle with this?