-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
112 lines (106 loc) · 3.97 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<style>
.image-container {
position: relative;
overflow: hidden;
width: 100%;
height: 0;
padding-bottom: 100%; /* Creates a square container based on width */
}
.image-container img {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%; /* Ensures the image covers the entire container */
height: 100%; /* Ensures the image covers the entire container */
object-fit: cover; /* Crops the image while maintaining aspect ratio */
}
.center-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: url('images/icon.jpeg') center center no-repeat; /* Replace 'path/to/your-icon.png' with your icon path */
background-size: contain;
width: 50px; /* Adjust the icon size as needed */
height: 50px; /* Adjust the icon size as needed */
}
</style>
<title>Image Resize with Bootstrap</title>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="image-container">
<img src="images/1.jpeg" class="img-fluid" alt="Image 1">
<div class="center-icon"></div>
</div>
</div>
<div class="col-md-4">
<div class="image-container">
<img src="images/2.jpeg" class="img-fluid" alt="Image 1">
<div class="center-icon"></div>
</div>
</div>
<div class="col-md-4">
<div class="image-container">
<img src="images/3.jpeg" class="img-fluid" alt="Image 1">
<div class="center-icon"></div>
</div>
</div>
<div class="col-md-4">
<div class="image-container">
<img src="images/4.jpeg" class="img-fluid" alt="Image 1">
<div class="center-icon"></div>
</div>
</div>
<div class="col-md-4">
<div class="image-container">
<img src="images/5.jpeg" class="img-fluid" alt="Image 1">
<div class="center-icon"></div>
</div>
</div>
<div class="col-md-4">
<div class="image-container">
<img src="images/6.jpeg" class="img-fluid" alt="Image 1">
<div class="center-icon"></div>
</div>
</div>
<div class="col-md-4">
<div class="image-container">
<img src="images/7.jpeg" class="img-fluid" alt="Image 1">
<div class="center-icon"></div>
</div>
</div>
<div class="col-md-4">
<div class="image-container">
<img src="images/8.jpeg" class="img-fluid" alt="Image 1">
<div class="center-icon"></div>
</div>
</div>
<div class="col-md-4">
<div class="image-container">
<img src="images/9.jpeg" class="img-fluid" alt="Image 1">
<div class="center-icon"></div>
</div>
</div>
<div class="col-md-4">
<div class="image-container">
<img src="images/10.jpeg" class="img-fluid" alt="Image 1">
<div class="center-icon"></div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</body>
</html>