I am attempting to position the add button in the middle of the box, not just centered, but truly in the middle of it.
.gallery {
background-color: #fbfbfb;
border-radius: 5px;
border-style: solid;
border: 1px solid #bbbbbb;
height: 85px;
line-height: 1;
box-sizing: border-box;
margin: 12px;
height: auto;
}
input[type="file"] {
display: none;
}
.images-upload {
background-color: #ffffff;
border-radius: 5px;
border: 1px dashed #ccc;
display: inline-block;
padding: 3px;
cursor: pointer;
width: 165px;
height: 85px;
}
.images-preview {
border-radius: 5px;
border: 1px solid #ccc;
display: inline-block;
width: 165px;
height: 85px;
padding-top: -14px;
}
.button-container {
height: 90px;
display: inline-block;
}
.image-container {
height: 90px;
width: 15%;
display: inline-block;
}
.custom-icon {
color: #00afca;
}
.close-btn {
background: none;
color: white;
border: none;
padding: 0;
font: inherit;
cursor: pointer;
outline: inherit;
position: relative;
left: -160px;
top: -15px;
box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
width: 0px;
}
.close-btn:hover {
color: red;
box-shadow: red 0px 7px 29px 0px;
}
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1a7875756e696e687b6a5a2f342b3429">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="./assets/css/style.css" class="href">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/css/all.min.css" integrity="sha512-YWzhKL2whUzgiheMoBFwW8CKV4qpHQAEuvilg9FAn5VJUDwKZZxkJNuGM4XkWuk94WCrrwslk8yWNGmY1EduTA==" crossorigin="anonymous" referrerpolicy="no-referrer"
/>
</head>
<body>
<div class="container">
<div class="gallery w-100 m-2">
<div class="p-3">
<div class="button-container my-1">
<div for="images-upload" class="images-upload">
<i class=" fas fa-plus-circle fa-3x custom-icon"></i>
</div>
<input id="images-upload" type="file" name="images" multiple="multiple">
</div>
<div class="image-container d-inline my-1">
<img src="https://via.placeholder.com/200x150" alt="" class="images-preview">
<button class="close-btn"> <i class="fas fa-2x fa-times"></i></button>
</div>
</div>
</div>
</div>
</body>